How to Setup Project With Build Process
Question
How can I setup Webstorm to recognize the final structure after the build and relate to the source files? Files have source maps attached. E.g.
- Running unit tests on single files/functions.
- Avoid warnings/error that files are not found, e.g src/a requires a file from src/b which is after the build in the same folder but not before.
- Jump to functions etc.
The build process is done via gulp, so it is not about Webstorm building the application. It is about Webstorm recognizing the final structure while working in the source structure.
E.g. left side of the image below is source and the right side is the compiled one in dist. On the left side the module is not found because the relative path does not exist, but it will exist after the build process in dist.

Structure
before build:
- src/a1
- src/a2
- src/b1
- src/b2
after build:
- dist/a
- dist/b
Please sign in to leave a comment.
description is too vague so no definite instructions can be given
>Running unit tests on single files/functions.
what problems doing this have you faced?
>Avoid warnings/error that files are not found, e.g src/a requires a file from src/b which is after the build in the same folder but not before
Suppressing the warning is the only option here.
>Jump to functions etc.
please elaborate on this
e.g.
```
src/a/a.js:
exports.a = () => {
}
src/b/b.js:
const someModule = require('./a');
someModule.a(); // <= use jump to source here
```
Gets compiled to dist/a.js, dist/b.js. Because Webstorm does not recognize the final compiled file structure it does not find the file here const someModule = require('./a');. If the action "jump to source" is used it will not jump to `exports.a`.
Anyway, it's not about particular examples. The main question is: Can I get Webstorm to recognize the final compiled structure?
No, it would never resolve files that don't yet exist.