UNPKG

webpack

Version:

Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.

25 lines (23 loc) 700 B
var path = require("path"); var CommonsChunkPlugin = require("../../lib/optimize/CommonsChunkPlugin"); module.exports = { entry: { // The entry points for the pages pageA: "./aEntry", pageB: "./bEntry", // This file contains common modules but also the router entry "commons.js": "./router" }, output: { path: path.join(__dirname, "js"), publicPath: 'js/', filename: "[name].bundle.js", chunkFilename: "[id].chunk.js" }, plugins: [ // Extract common modules from the entries to the commons.js file // This is optional, but good for performance. new CommonsChunkPlugin("commons.js") // The pages cannot run without the commons.js file now. ] }