-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.js
42 lines (41 loc) · 1.16 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
const path = require("path");
module.exports = {
optimization: {
minimize: false, // ease code review by webextension stores
},
devtool: false, // related to optimization.minimize=false and https://bugzilla.mozilla.org/show_bug.cgi?id=1437937
entry: {
"injectable-content-script": "./src/injectable-content-script.ts",
"options/main": "./src/options/main.ts",
"popup/main": "./src/popup/main.ts",
"background-listeners-setup": "./src/background-listeners-setup.ts"
},
output: {
path: path.resolve(__dirname, "addon"),
filename: "[name].js"
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.(html|svelte)$/,
use: {
loader: 'svelte-loader',
options: {
preprocess: require('svelte-preprocess')({}), // TypeScript support
},
},
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.svelte', '.mjs'],
alias: { svelte: path.resolve('node_modules', 'svelte') },
mainFields: ['svelte', 'browser', 'module', 'main'],
},
};