forked from zirkler/tresor-import
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
39 lines (35 loc) · 994 Bytes
/
webpack.dev.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
const path = require('path');
const WaitPlugin = require('./demo/WaitPlugin');
// bundles source of tresor-import AND demo page into demo/bundle to power the demo
const importConfig = {
mode: 'development',
watch: true,
entry: './src/index.js',
devtool: 'inline-source-map',
output: {
filename: 'tresor-import.js',
path: path.resolve(__dirname, 'demo/bundle'),
libraryTarget: 'umd',
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src/'),
},
},
};
const demoConfig = {
mode: 'development',
watch: true,
entry: './demo/js/main.js',
devtool: 'inline-source-map',
output: {
filename: 'tresor-demo.js',
path: path.resolve(__dirname, 'demo/bundle'),
libraryTarget: 'umd',
},
plugins: [
// Prevent error `Module demo/bundle/tresor-import.js not found` due to parallel build of webpack.
new WaitPlugin(path.resolve(__dirname, 'demo/bundle', 'tresor-import.js')),
],
};
module.exports = [importConfig, demoConfig];