encounter a demand, the front end uses webpack to package the pages you want, and the pages you don"t need are not packaged. After packaging, only the page code you want is pure. Gulp can be implemented at present. Does webpack have a solution?
encounter a demand, the front end uses webpack to package the pages you want, and the pages you don"t need are not packaged. After packaging, only the page code you want is pure. Gulp can be implemented at present. Does webpack have a solution?
of course there is. CommonsChunkplugin
before
webpack4.x extracts the common code, and SplitChunks
after webapck4.x implements the same function.
use tree shaking
to implement the code that gets the specified functional block of the specified file.
use code splitting
to convert large files of build output into several small files.
use entry
to control webpack
for chunk
, use chunk
to control input and output, and
use html-webpack-plugin
options.chunk
to specify chunk
for the generated * .html
file.
all in all, at least 90% of the functions in your daily development can be implemented by webpack.
if you want to learn more about webpack
, you can refer to the classmate's webpack-play
, which has a lot of summary and sample code.
problem description vue2 + webpack3 production environment packaging, in ubantu16 environment packaging, password input box into plaintext input; windows packaging is normal. I lost my type= "password " by force this is the result of packaging in...
there is a requirement to selectively package the code in the js file when packaging using webpack, just like the plug-in packaged by HTML, using the template syntax of the package to selectively package HTML? ...