-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
37 lines (36 loc) · 888 Bytes
/
webpack.config.js
File metadata and controls
37 lines (36 loc) · 888 Bytes
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
import path from "path";
import NodePolyfillPlugin from "node-polyfill-webpack-plugin";
export default {
entry: "./src/index.js",
optimization: {
minimize: true,
},
target: "webworker",
output: {
filename: 'index.cjs',
path: path.resolve(import.meta.dirname, "bin"),
chunkFormat: 'commonjs',
library: {
type: 'commonjs',
},
},
module: {
// Loaders go here.
// e.g., ts-loader for TypeScript
// rules: [
// ],
},
plugins: [
// Polyfills go here.
// Used for, e.g., any cross-platform WHATWG,
// or core nodejs modules needed for your application.
new NodePolyfillPlugin({
excludeAliases: ["console"],
}),
],
externals: [
// Allow webpack to handle 'fastly:*' namespaced module imports by treating
// them as modules rather than trying to process them as URLs
/^fastly:.*$/,
],
};