-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
52 lines (50 loc) · 1023 Bytes
/
webpack.config.js
File metadata and controls
52 lines (50 loc) · 1023 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
45
46
47
48
49
50
51
52
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const src = path.join(__dirname, 'src');
const dst = path.join(__dirname, 'dist');
module.exports = {
mode: "development",
devtool: 'inline-source-map',
entry: {
'index': path.join(src, 'index.js')
},
output: {
path: dst,
filename: '[name].js'
},
devServer: {
contentBase: __dirname,
port: 8080,
hot: true
},
module: {
rules: [{
test: /\.css$/,
use: [
"style-loader",
{
loader: "css-loader",
options: { url: false }
}
]
}, {
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
}]
},
resolve: {
extensions: [ '.ts', '.js' ]
},
plugins: [
new CopyWebpackPlugin({
patterns: [{
from: path.join(src, 'style.css'),
to: path.join(dst, 'style.css')
},{
from: path.join(src, 'images'),
to: path.join(dst, 'images'),
}]
})
]
}