webpack usage record

For webpack learning path
reference: webpack series

webpack configuration template exercise

  1. Introduce vue and jq, (hope to achieve, multi-page application + jq framework,)
  2. When introducing monitoring.js, you can ignore unnecessary language packs and manually introduce the corresponding language;
  3. For some optimization items, you can use dllpulgin to dynamically link the manifest.json file
  4. Use happypack for multi-threaded packaging, id,
  5. optimization(chunkCommonPlugin) Multi-page, extract the repeated reference files and put them in one file
  6. do while execute at least once

  1. Import html files, import plugin html-webpack-plugin

  2. css, note: loader is right to left, execute from bottom to top

  • The first is style-loader css-loader,
    mini-css-extract-plugin,
    optimize-css-assets-webpack-plugin//compress
    uglifyjs-webpack-plugin
    postcss-loader (plus prefix) (less)less-loader, node -sass,(sass-loader) ,stylus-loader
  1. js module
  • (babel), babel-loader, @babel/core, @babel/preset-env (conversion es6 syntax), @babel/plugin-proposal-class-properties (class syntax)
  • "@Babel/plugin-transform-runtime" (run)
    "html-webpack-plugin" (production environment)

Guess you like

Origin blog.csdn.net/ZHXT__/article/details/114804472