-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webextension-toolbox.config.js
28 lines (27 loc) · 1.04 KB
/
webextension-toolbox.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
const path = require("path");
const GlobEntriesPlugin = require("webpack-watched-glob-entries-plugin");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
module.exports = {
webpack: (config) => {
// Add typescript loader. supports .ts and .tsx files as entry points
config.resolve.extensions.push(".ts");
config.resolve.extensions.push(".tsx");
config.resolve.fallback = { fs: false };
config.entry = GlobEntriesPlugin.getEntries([
path.resolve("app", "*.{js,mjs,jsx,ts,tsx}"),
path.resolve("app", "?(scripts)/*.{js,mjs,jsx,ts,tsx}")
]);
config.module.rules.push({
test: /\.tsx?$/,
loader: "ts-loader"
});
config.module.rules.push({
test: /\.css$/,
use: ["style-loader", "css-loader"]
});
config.plugins.push(new NodePolyfillPlugin());
// Important: return the modified config
return config;
},
copyIgnore: ["**/*.js", "**/*.json", "**/*.ts", "**/*.tsx"]
};