-
Notifications
You must be signed in to change notification settings - Fork 18
/
webpack.config.js
96 lines (85 loc) · 1.79 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
const path = require('path');
//const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
//const saveLicense = require('uglify-save-license');
const babelOptions = {
"presets": [ [ "@babel/preset-env", {
modules: false,
targets: {
browsers: ["last 2 versions"]
}
} ] ]
};
module.exports = {
mode: 'development',
entry: {
library: ['url-search-params-polyfill', 'babel-polyfill', 'whatwg-fetch', './static/js/library.js'],
schematic: ['url-search-params-polyfill', 'babel-polyfill', 'whatwg-fetch', './static/js/common.js', './static/js/schematic.js'],
pcb: ['url-search-params-polyfill', 'babel-polyfill', 'whatwg-fetch', './static/js/common.js', './static/js/pcb.js'],
viewer: ['url-search-params-polyfill', 'babel-polyfill', 'whatwg-fetch', './static/js/common.js', './static/js/viewer.js'],
worker: ['babel-polyfill', './static/js/common.js', './static/js/worker.js'],
},
output: {
path: __dirname + "/static/js",
filename: '[name].bundle.js',
},
node: {
'fs': 'empty',
},
devtool: 'source-map',
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js'
},
extensions: ['.ts', '.js'],
modules: [
path.join(__dirname, "src"),
"node_modules"
]
},
module: {
rules: [
{
test: /\.html?$/,
use: [
{
loader: 'raw-loader',
},
]
},
{
test: /\.js?$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: babelOptions,
}
]
},
{
test: /\.ts?$/,
use: [
/*
{
loader: 'babel-loader',
options: babelOptions,
},
*/
{
loader: 'ts-loader'
}
],
exclude: /node_modules/
},
]
},
plugins: [
// new UglifyJSPlugin({
// sourceMap: true,
// parallel: true,
// output: {
// comments: saveLicense
// }
// })
]
};