-
Notifications
You must be signed in to change notification settings - Fork 28
/
webpack.config.js
36 lines (31 loc) · 1.2 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
process.traceDeprecation = true;
const mf_config = require("@patternslib/dev/webpack/webpack.mf");
const path = require("path");
const package_json = require("./package.json");
const package_json_mockup = require("@plone/mockup/package.json");
const patternslib_config = require("@patternslib/dev/webpack/webpack.config.js");
module.exports = async (env, argv) => {
let config = {
entry: {
"datagridfield.min": path.resolve(__dirname, "resources/datagridfield-config"),
},
};
config = patternslib_config(env, argv, config, ["@plone/mockup"]);
config.output.path = path.resolve(__dirname, "src/collective/z3cform/datagridfield/static");
config.plugins.push(
mf_config({
name: "datagridfield",
filename: "datagridfield-remote.min.js",
remote_entry: config.entry["datagridfield.min"],
dependencies: {
...package_json_mockup.dependencies,
...package_json.dependencies,
},
})
);
if (process.env.NODE_ENV === "development") {
config.devServer.port = "8011";
config.devServer.static.directory = `${__dirname}/resources`;
}
return config;
};