forked from AuraQ/AutoCompleteForMendix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
38 lines (36 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
37
38
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require("path");
const package = require("./package");
const widgetName = package.widgetName;
module.exports = {
entry: {
[widgetName]: [ `./src/${widgetName}/widget/${widgetName}.js` ],
},
output: {
path: path.resolve(__dirname, "dist/tmp/src"),
filename: `${widgetName}/widget/[name].js`,
chunkFilename: `${widgetName}/widget/${widgetName}[id].js`,
libraryTarget: "amd",
publicPath: "widgets/"
},
mode: "production",
devtool: false,
externals: [ /^mxui\/|^mendix\/|^dojo\/|^dijit\// ],
plugins: [
new webpack.LoaderOptionsPlugin({ debug: true }),
new MiniCssExtractPlugin({
filename: `./${widgetName}/widget/ui/${widgetName}.css`
}),
new CopyWebpackPlugin({patterns: [{ context: "src", from: "**/*.xml" }, { context: "src", from: "**/*.html" }]})
],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, "css-loader"],
}
]
}
};