-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
50 lines (45 loc) · 1.11 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
44
45
46
47
48
49
50
import webpack from "webpack";
import path from "path";
import ESLintPlugin from 'eslint-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
import TerserPlugin from "terser-webpack-plugin";
const __dirname = path.resolve();
let config = {
entry: {
'geoportal-wfs-client': ['./src/Client.js'],
'geoportal-wfs-client.min': ['./src/Client.js'],
},
output: {
library: {
name: 'GeoportalWfsClient',
type: 'umd',
export: "default"
},
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
globalObject: 'this'
},
plugins: [
new CleanWebpackPlugin({
verbose: false,
dry: false
}),
new NodePolyfillPlugin(),
new ESLintPlugin({
extensions: ['js'],
exclude: ["node_modules"],
fix: true
}),
],
optimization: {
minimizer: [
new TerserPlugin({
test: /\.min\.js$/,
extractComments: false // Empécher la création de fichiers *.LICENCE.txt inutiles
})
],
minimize: true,
},
};
export default config;