2023-12-18 15:56:41 +08:00
|
|
|
const path = require("path")
|
2023-12-18 16:35:45 +08:00
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2023-12-18 15:56:41 +08:00
|
|
|
|
|
|
|
module.exports = {
|
2023-12-18 16:35:45 +08:00
|
|
|
entry: {
|
|
|
|
"index": "./src/index.ts"
|
|
|
|
},
|
2023-12-18 15:56:41 +08:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, "dist"),
|
2023-12-18 16:35:45 +08:00
|
|
|
filename: "[name].js"
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js', '.less', 'png'],
|
2023-12-18 15:56:41 +08:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: "ts-loader",
|
|
|
|
exclude: "/node-modules/"
|
2023-12-18 16:35:45 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
|
|
|
use: [
|
|
|
|
MiniCssExtractPlugin.loader,
|
|
|
|
{
|
|
|
|
loader: 'css-loader', // translates CSS into CommonJS
|
|
|
|
options: {
|
|
|
|
url: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"less-loader"
|
|
|
|
]
|
2023-12-18 15:56:41 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2023-12-18 16:35:45 +08:00
|
|
|
plugins: [
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: "index.css"
|
|
|
|
})
|
|
|
|
],
|
2023-12-18 15:56:41 +08:00
|
|
|
mode: "development"
|
|
|
|
}
|