Merge pull request #1280 from thelounge/xpaw/simple-vendor
Do not hardcode vendor bundles in webpack
This commit is contained in:
commit
17978af710
5
scripts/noop.js
Normal file
5
scripts/noop.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = function() {
|
||||||
|
return function() {};
|
||||||
|
};
|
@ -10,17 +10,6 @@ const path = require("path");
|
|||||||
const config = {
|
const config = {
|
||||||
entry: {
|
entry: {
|
||||||
"js/bundle.js": path.resolve(__dirname, "client/js/lounge.js"),
|
"js/bundle.js": path.resolve(__dirname, "client/js/lounge.js"),
|
||||||
"js/bundle.vendor.js": [
|
|
||||||
"handlebars/runtime",
|
|
||||||
"jquery",
|
|
||||||
"jquery-textcomplete",
|
|
||||||
"jquery-ui/ui/widgets/sortable",
|
|
||||||
"moment",
|
|
||||||
"mousetrap",
|
|
||||||
"socket.io-client",
|
|
||||||
"urijs",
|
|
||||||
"fuzzy",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
devtool: "source-map",
|
devtool: "source-map",
|
||||||
output: {
|
output: {
|
||||||
@ -71,7 +60,13 @@ const config = {
|
|||||||
json3: "JSON", // socket.io uses json3.js, but we do not target any browsers that need it
|
json3: "JSON", // socket.io uses json3.js, but we do not target any browsers that need it
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.optimize.CommonsChunkPlugin("js/bundle.vendor.js")
|
// socket.io uses debug, we don't need it
|
||||||
|
new webpack.NormalModuleReplacementPlugin(/debug/, path.resolve(__dirname, "scripts/noop.js")),
|
||||||
|
// automatically split all vendor dependancies into a separate bundle
|
||||||
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
|
name: "js/bundle.vendor.js",
|
||||||
|
minChunks: (module) => module.context && module.context.indexOf("node_modules") !== -1
|
||||||
|
})
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user