-

   rss_habrahabr_of_lokoman

 - e-mail

 

 -

 LiveInternet.ru:
: 16.03.2008
:
:
: 2

:


[ ] Webpack SplitChunksPlugin

, 20 2019 . 21:47 +

Webpack 4. C . 4 :


const path = require("path");

const PATHS = {
  src: path.resolve(process.cwd(), "src"),
  dist: path.resolve(process.cwd(), "dist")
};

module.exports = {
  entry: {
    common: `${PATHS.src}/js/common`,
    index: `${PATHS.src}/js/index`,
    contacts: `${PATHS.src}/js/contacts`,
    about: `${PATHS.src}/js/about`,
  }
}

. common . Webpack'a HtmlWebpackPlugin.


:


  module.exports = {
  ...
  plugins: [
    new HtmlWebpackPlugin({
      filename: `${PATHS.dist}/index.html`,
      template: `${PATHS.dist}/index.html`,
      chunks: ["index", "common"]
    })
    ...
  ]
  ...
};

https://habr.com/ru/post/441076/?utm_source=habrahabr&utm_medium=rss&utm_campaign=441076

:  

: [1] []
 

:
: 

: ( )

:

  URL