-
Notifications
You must be signed in to change notification settings - Fork 19
/
webpack.config.js
47 lines (46 loc) · 1.25 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
const Path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
mode: "production",
devtool: "inline-source-map",
entry: {
background: Path.join(__dirname, "src", "background", "background.ts"),
session: Path.join(__dirname, "src", "session", "session.ts"),
popup: Path.join(__dirname, "src", "popup", "popup.ts"),
},
output: {
path: Path.join(__dirname, "dist", "js"),
filename: "[name].js"
},
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/
},
{
test: /\.svelte$/,
loader: "svelte-loader",
options: {
emitCss: true,
hotReload: true,
preprocess: require("svelte-preprocess")({})
}
},
{
test: /\.css/,
use: ["style-loader", "css-loader"]
}
]
},
resolve: {
extensions: [".ts", ".svelte", ".mjs", ".js"]
},
plugins: [
new CopyPlugin({
patterns: [{ from: "public", to: ".." }]
}
)
]
};