2024-02-15 03:54:23 +00:00
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
entry: "./src/index.ts",
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.ts$/,
|
|
|
|
use: "ts-loader",
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.html/,
|
2024-02-21 05:45:14 +00:00
|
|
|
type: "asset/resource",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.s[ac]ss$/i,
|
|
|
|
use: [
|
|
|
|
// Creates `style` nodes from JS strings
|
|
|
|
"style-loader",
|
|
|
|
// Translates CSS into CommonJS
|
|
|
|
"css-loader",
|
|
|
|
// Compiles Sass to CSS
|
|
|
|
"sass-loader",
|
|
|
|
],
|
|
|
|
},
|
2024-02-15 03:54:23 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
2024-02-21 05:45:14 +00:00
|
|
|
extensions: [".ts", ".scss", ".css"],
|
2024-02-15 03:54:23 +00:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: "main.js",
|
|
|
|
path: path.resolve(__dirname, "dist"),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
module.exports = (env, argv) => {
|
|
|
|
if (argv.mode === "development") {
|
|
|
|
config.devtool = "source-map";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (argv.mode === "production") {
|
|
|
|
}
|
|
|
|
|
|
|
|
return config;
|
2024-02-21 05:45:14 +00:00
|
|
|
};
|