-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (42 loc) · 922 Bytes
/
webpack.config.js
File metadata and controls
44 lines (42 loc) · 922 Bytes
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
const path = require('path')
const source = path.resolve(__dirname, 'source')
const build = path.resolve(__dirname, 'build')
const production = process.env.NODE_ENV === 'production'
module.exports = {
entry: path.join(source, production ? 'Graph.js' : 'index.js'),
output: {
path: build,
filename: 'index.js',
publicPath: '/',
libraryTarget: production ? 'commonjs2': undefined
},
mode: process.env.NODE_ENV || 'development',
devServer: {
host: '0.0.0.0',
publicPath: '/',
port: 9999,
index: 'index.html',
disableHostCheck: true
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.(css)$/,
use: [
"style-loader",
"css-loader",
]
}
]
},
resolve: {
alias: { // to reduce bundle size
"konva": path.resolve(source, "konva.js"),
}
}
};