This commit is contained in:
wxhao
2025-10-31 15:58:34 +08:00
parent 2ef5c6b3f5
commit d0661b9b8e
6 changed files with 472 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import path from 'path';
import { fileURLToPath } from 'url';
import HtmlWebpackPlugin from 'html-webpack-plugin';
// 处理ES模块中的__dirname
const __filename = fileURLToPath(import.meta.url);
@@ -24,6 +25,12 @@ export default {
port: 3000,
historyApiFallback: true,
},
plugins: [
new HtmlWebpackPlugin({
template: './index.html',
favicon: './assets/favicon.ico',
}),
],
module: {
rules: [
{
@@ -35,10 +42,10 @@ export default {
options: {
transpileOnly: true,
compilerOptions: {
noEmit: false
}
}
}
noEmit: false,
},
},
},
],
},
{
@@ -74,4 +81,4 @@ export default {
},
extensions: ['.tsx', '.ts', '.jsx', '.js'],
},
};
};