-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
35 lines (34 loc) · 1.15 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
const path = require('path');
const WebExtWebpackPlugin = require('@ianwalter/web-ext-webpack-plugin');
module.exports = {
// No need for uglification etc.
mode: 'development',
devtool: 'source-map',
module: {
rules: [
{ test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/ },
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
],
},
resolve: {
extensions: ['.ts', '.js'],
},
entry: {
'content': path.resolve(__dirname, './src/content/index.ts'),
'background': path.resolve(__dirname, './src/background.ts'),
'options': path.resolve(__dirname, './src/options/options.js'),
'vn-hook': path.resolve(__dirname, './src/vn-hook/index.ts')
},
plugins: [
new WebExtWebpackPlugin({
browserConsole: true,
startUrl: ['https://en.wikipedia.org/wiki/Ky%C5%8Diku_kanji'],
sourceDir: path.resolve(__dirname, './'),
}),
],
output: {
path: path.resolve(__dirname, 'build'),
filename: '[name].js',
},
};