mirror of
https://github.com/zhigang1992/notion-api-worker.git
synced 2026-01-12 17:32:42 +08:00
33 lines
644 B
JavaScript
33 lines
644 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
const path = require("path");
|
|
|
|
const mode = process.env.NODE_ENV || "production";
|
|
|
|
module.exports = {
|
|
output: {
|
|
filename: `worker.${mode}.js`,
|
|
path: path.join(__dirname, "dist"),
|
|
},
|
|
target: "webworker",
|
|
devtool: "source-map",
|
|
mode,
|
|
resolve: {
|
|
extensions: [".ts", ".js"],
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
loader: "ts-loader",
|
|
options: {
|
|
transpileOnly: true,
|
|
},
|
|
},
|
|
{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" },
|
|
],
|
|
},
|
|
optimization: {
|
|
usedExports: true,
|
|
},
|
|
};
|