I have Angular app built with npm and web-pack served on Tomcat web server.
Command npm run build
builds all JS files into /build
directory of the project, but npm start
uses /out
directory.
Is there any way to force npm start
using /build
directory as well?
Why I need this: Currently JS content is served together with backend written with Java and there is no difference between production run and dev run (both use the same build folder). It would also be convenient to have the same on frontend side.
UPDATE: I've solved the problem by enhancing webpack config
npm start
runs webpack under the hood which is configured via .js
script.
I have updated section:
output: {
path: helpers.root('../build'),
publicPath: '/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
}
pointing to the ./build
directory.