-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
32 lines (30 loc) · 909 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
const path = require('path');
const Dotenv = require('dotenv-webpack');
module.exports = (env, argv) => {
const envPath = argv.mode === 'development' ? '.env' : `.env.${argv.mode}`;
return {
entry: {
dist: {import: './src/app/catalunya-map-main', filename: `./dist/${argv.mode}/catalunya-map.min.js`},
web: {import: './src/app/catalunya-map-main', filename: `./web/js/catalunya-map.min.js`},
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, './'),
},
plugins: [
new Dotenv({
path: envPath
})
],
devServer: {
static: {
directory: path.join(__dirname, './web'),
},
compress: true,
port: 9000,
},
externals: {
jquery: 'jQuery',
},
};
};