2024-10-22 07:02:04 +02:00
|
|
|
const path = require("path");
|
|
|
|
module.exports = (env, argv) => {
|
|
|
|
return {
|
|
|
|
mode: "development",
|
|
|
|
devtool: "source-map",
|
2024-10-23 00:44:19 +02:00
|
|
|
entry: "./src/index.ts",
|
2024-10-22 07:02:04 +02:00
|
|
|
output: {
|
2024-10-23 00:44:19 +02:00
|
|
|
filename: "index.mjs",
|
2024-10-22 07:02:04 +02:00
|
|
|
path: path.resolve(__dirname, "..", "dist"),
|
2024-10-23 00:44:19 +02:00
|
|
|
library: { type: "module" },
|
2024-10-22 07:02:04 +02:00
|
|
|
},
|
|
|
|
experiments: { outputModule: true },
|
|
|
|
resolve: {
|
|
|
|
modules: [path.resolve(__dirname, "..", "node_modules")],
|
|
|
|
alias: {
|
|
|
|
"@json": path.resolve(__dirname, "..", "src", "json"),
|
|
|
|
"~": path.resolve(__dirname, "..", "src", "js"),
|
|
|
|
},
|
|
|
|
extensions: [".js", ".ts", ".json"],
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: "babel-loader",
|
|
|
|
exclude: /node_modules/,
|
|
|
|
options: { presets: ["@babel/preset-env", "@babel/preset-typescript"] },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [],
|
|
|
|
optimization: {}
|
|
|
|
}
|
|
|
|
};
|