Quran.js/etc/webpack.config.js
2024-10-22 19:44:19 -03:00

34 lines
840 B
JavaScript

const path = require("path");
module.exports = (env, argv) => {
return {
mode: "development",
devtool: "source-map",
entry: "./src/index.ts",
output: {
filename: "index.mjs",
path: path.resolve(__dirname, "..", "dist"),
library: { type: "module" },
},
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: {}
}
};