-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (49 loc) · 1.48 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
import * as path from "node:path";
import WebExtPlugin from "web-ext-plugin";
import CopyPlugin from "copy-webpack-plugin";
import {fileURLToPath} from "node:url";
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename);
export default {
entry: './src/index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dev'),
},
devServer: {
static: './dev',
},
devtool: 'source-map',
mode: 'development',
plugins: [
new WebExtPlugin({
sourceDir: path.resolve(__dirname, 'dev'),
firefox: "C:\\Program Files\\Firefox Developer Edition\\firefox.exe",
firefoxProfile: "C:\\Users\\Vivien\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\kv2tckr8.dev-edition-default",
startUrl: ["https://x.com/messages", "about:debugging#/runtime/this-firefox"],
}),
new CopyPlugin({
patterns: [
{from: 'assets', to: 'assets'},
{from: 'devEnv', to: './'},
{from: 'manifest.json', to: 'manifest.json'}
]
})
]
};