forked from clmnin/summarize.site
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
52 lines (51 loc) · 1.35 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
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
content: ['regenerator-runtime/runtime.js', path.resolve(__dirname, './src/content/index.js')],
background: ['regenerator-runtime/runtime.js', path.resolve(__dirname, './src/background/index.js')],
},
devtool: 'inline-source-map',
resolve: {
extensions: ['.tsx', '.ts', '.js', '.jsx'],
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'build'),
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
},
],
},
{
test: /\.svg$/,
type: 'asset/inline',
},
{
test: /\.css$/i,
use: 'css-loader',
},
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'public/manifest.json', to: 'manifest.json' },
{ from: 'public/res/logo.png', to: 'logo.png' },
{ from: 'public/res/logo-128.png', to: 'logo-128.png' },
{ from: 'public/styles.css', to: 'styles.css' },
{ from: 'public/options.html', to: 'options.html' },
{ from: 'public/options.js', to: 'options.js' },
],
}),
new CleanWebpackPlugin(),
],
};