-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
55 lines (51 loc) · 1.23 KB
/
webpack.config.ts
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
import { Configuration } from 'webpack'
import path from 'path'
import CopyPlugin from 'copy-webpack-plugin'
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const dist = path.join(__dirname, 'dist')
const src = path.join(__dirname, 'src')
const config: Configuration = {
entry: {
content_script: path.join(src, 'content_script.ts'),
background: path.join(src, 'background.ts'),
popup: path.join(src, 'popup.ts'),
chat: path.join(src, 'chat.ts')
},
output: {
path: dist,
filename: '[name].js'
},
module: {
rules: [
{
test: /.ts$/,
use: 'ts-loader',
exclude: '/node_modules/'
},
{
test: /.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader'
]
}
]
},
resolve: {
extensions: ['.ts', '.js']
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'manifest.json', to: dist },
{ from: '*.html', to: dist, context: src },
{ from: 'img/*.*', to: dist, context: src }
]
}),
new MiniCssExtractPlugin({
filename: 'content_style.css'
})
]
}
export default config