Skip to content

Instantly share code, notes, and snippets.

@Landish
Last active May 25, 2023 13:47
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Landish/4c4796f0a694af075be69c4f54a8fd3b to your computer and use it in GitHub Desktop.
Save Landish/4c4796f0a694af075be69c4f54a8fd3b to your computer and use it in GitHub Desktop.
jsconfig.json

jsconfig.json

{
  "compilerOptions": {
    "baseUrl": "./src",
    "target": "ES6",
    "jsx": "preserve",
    "allowSyntheticDefaultImports": true
  },
  "exclude": ["build", "node_modules"]
}

.env

NODE_PATH=src

package.json

{
  "scripts": {
    "start": "cross-env NODE_PATH=src react-scripts start",
  }
}

Webstorm

  1. Mark src directory as Resource Root
  2. Go to Settings -> Editor -> Code Style -> Javascript.
  3. Switch to Imports tab and select Use paths relative to the project, resource or sources root.
@hlthi
Copy link

hlthi commented Nov 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment