S
S
Sergey2017-07-13 03:54:06
webpack
Sergey, 2017-07-13 03:54:06

How to prepare .js files from webpack for production?

Greetings. Due to the fact that at the moment 'bower is maintained', I decided to try webpack, but I probably ran into a misunderstanding of this tool.
Let's take, for example, a standard one-page html/css/javascript website template. With the help of webpack in the development stage, this is all assembled into one 'bundle.js', for production we take out the css in our file, and js should remain in 'bundle.js', along with the webpack header, which will be included in 'index. html' via script? Or is there still a plugin / way to pull pure js from the bundle?
PS Previously, I collected this with gulp, in build.js there was only my code, without "garbage".
PPS webpack 3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alvvi, 2017-07-13
@Inviqus

For production, it should be minified, all these headers there will be indistinguishable from regular code.
Pulling out pure JS does not make sense, you will lose one of the main advantages of Webpack - modularity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question