-
Notifications
You must be signed in to change notification settings - Fork 25
/
webpack.config.babel.js
56 lines (54 loc) · 1.23 KB
/
webpack.config.babel.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
import path from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
const src = path.join(__dirname, 'src');
const dst = path.join(__dirname, 'app');
module.exports = {
mode: "development",
devtool: 'inline-source-map',
entry: {
'js/background': './src/ts/background.ts',
'js/lazy': './src/ts/lazy.ts',
'js/web-animations-next-lite.min.js': './src/ts/web-animations-next-lite.min.js',
'components/ptm-app': './src/components/ptm-app.ts'
},
output: {
path: dst,
filename: '[name].js'
},
devServer: {
contentBase: __dirname,
port: 8080,
hot: true
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/
}
]
},
resolve: {
extensions: [ '.ts', '.js' ]
},
plugins: [
new CopyWebpackPlugin([{
from: path.join(src, '_locales'),
to: path.join(dst, '_locales')
},{
from: path.join(src, 'img'),
to: path.join(dst, 'img')
},{
from: path.join(src, 'styles'),
to: path.join(dst, 'styles')
},{
from: path.join(src, '*.html'),
to: dst,
flatten: true
},{
from: path.join(src, 'manifest.json'),
to: path.join(dst, 'manifest.json')
}])
]
}