-
Notifications
You must be signed in to change notification settings - Fork 53
/
webpack.config.js
executable file
·43 lines (42 loc) · 1 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const path = require("path"),
removeEmptyScriptsPlugin = require("webpack-remove-empty-scripts"),
webpackConfig = require("@wordpress/scripts/config/webpack.config");
// Extend the @wordpress webpack config and add the entry points.
module.exports = {
...webpackConfig,
...{
mode: "production",
devServer: {
static: {
directory: path.join(__dirname, "assets"),
},
client: {
overlay: false,
},
// open: ["http://localhost"], // (Optional) Add your local domain here
liveReload: true,
hot: false,
compress: true,
devMiddleware: {
writeToDisk: true,
},
},
context: path.resolve(__dirname, "assets"),
entry: ["./main.js", "./main.scss"],
// jQuery support
/*externals: {
jquery: "jQuery",
},*/
plugins: [
...webpackConfig.plugins,
/*new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
}),*/
new removeEmptyScriptsPlugin({
stage: removeEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
}),
],
},
};