Answer the question
In order to leave comments, you need to log in
Angular2 webpack what to do with requests to node_modules folder?
through webpack, I compile the Angular2 application npm run build
on the output,
transfer it to the server folder, open it in the browser and see that scripts are being loaded from node_modules (which, of course, is not there)
what should I do with this copy the folder to the server? Or something where in the configs you need to change?
Answer the question
In order to leave comments, you need to log in
You don't need to copy the entire folder. pull out only what is connected in index.html via script
The configs must specify the directory for output, vendor - this is the collected (possibly minified by you) either baver or node modules or that should be connected to the index.html file.
Perhaps scripts of node modules were previously connected in index.html.
I also have a suspicion that this is all, along with the assembly, lies at the root and when the server is raised, they give errors, especially since either node of the module has a status of not 400, but 500
You have taken a template from SystemJS and are using it with webpack. Firstly, the template from the docks is purely educational and should not be used in production, and secondly, systemjs does not make any sense with webpack.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question