webpack/examples/dll-entry-only/webpack.config.js

27 lines
543 B
JavaScript
Raw Normal View History

"use strict";
2024-07-31 09:56:53 +08:00
const path = require("path");
const webpack = require("../../");
2018-05-23 04:27:41 +08:00
module.exports = {
2018-05-24 20:15:41 +08:00
// mode: "development" || "production",
2018-05-23 04:27:41 +08:00
entry: {
dll: ["./example"]
},
output: {
path: path.join(__dirname, "dist"),
filename: "[name].js",
2019-01-28 09:27:57 +08:00
library: "[name]_[fullhash]"
2018-05-23 04:27:41 +08:00
},
optimization: {
2018-05-24 20:15:41 +08:00
concatenateModules: true // this is enabled by default in production mode
2018-05-23 04:27:41 +08:00
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, "dist", "[name]-manifest.json"),
2019-01-28 09:27:57 +08:00
name: "[name]_[fullhash]",
2018-05-23 04:27:41 +08:00
entryOnly: true
})
]
};