mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
成功加载express
This commit is contained in:
31
webpack.config.js
Normal file
31
webpack.config.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
target: 'node',
|
||||
entry: './src/renderer.ts', // 入口文件路径
|
||||
output: { // 输出文件配置
|
||||
path: path.resolve(__dirname, 'dist'), // 输出目录路径
|
||||
filename: 'bundle.js' // 输出文件名
|
||||
},
|
||||
module: { // 模块配置
|
||||
rules: [ // 模块规则
|
||||
{
|
||||
test: /\.js$/, // 匹配.js文件
|
||||
exclude: /node_modules/, // 排除node_modules目录
|
||||
use: { // 使用的loader
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env']
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.ts$/, // 匹配.ts文件
|
||||
exclude: /node_modules/, // 排除node_modules目录
|
||||
use: { // 使用的loader
|
||||
loader: 'ts-loader'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user