-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
32 lines (30 loc) · 948 Bytes
/
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
/**
* External Dependencies
*/
const path = require("path")
/**
* WordPress Dependencies
*/
const defaultConfig = require("@wordpress/scripts/config/webpack.config.js")
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
module.exports = {
...defaultConfig,
externals: {
jquery: "jQuery",
},
entry: {
frontend: path.resolve(__dirname, "src", "index.js"), // for the front end.
frontend_rtl: path.resolve(__dirname, "src", "index_rtl.js"), // for the front end.
admin: path.resolve(__dirname, "src/admin/", "admin_index.js"), // for the admin panel.
admin_rtl: path.resolve(__dirname, "src/admin/", "admin_index_rtl.js"), // for the admin panel.
},
output: {
path: path.resolve(__dirname, "assets"),
filename: "scripts/[name].js",
},
plugins: [
new MiniCssExtractPlugin({
filename: "styles/[name].css", // relative to output.path
}),
],
}