Z
Z
zwezew2017-10-27 10:52:25
JavaScript
zwezew, 2017-10-27 10:52:25

Is there a way to index source folders in webpack?

I created the project structure, the assembly goes through Webpack, one minus is that you have to write similar paths for local files, for example

include pug/main-blocks/footer.pug

import '../../styles/main.scss';

import '../../js/custom/custom.js';

Is there any way to change this so that all paths work tax-free with modules installed via npm / yarn, i.e.
require('inputmask');
?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrspd, 2017-10-27
@zwezew

You can set resolve from the root of the project in the webpack config, then you can specify the absolute path.
If you want completely by analogy, then in fact you need to drive all the directories that are in the project into resolve.
The solution is so-so and will work slowly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question