You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
975 B

const { CleanWebpackPlugin } = require('clean-webpack-plugin')
module.exports = {
mode: "production",
// 指定webpack打包的时候要使用的模块
module: {
// 指定要价在的规则
rules: [
{
// test指定的是规则生效的文件,意思是,用ts-loader来处理以ts为结尾的文件
test: /\.ts$/,
exclude: /node_modules/,
use: [
// 配置babel
{
// 指定加载器
loader: 'babel-loader',
// 设置babel
options: {
presets: ['@babel/preset-env']
}
},
'ts-loader'
]
}
]
},
plugins: [
new CleanWebpackPlugin()
],
resolve: {
extensions: ['.ts', '.js']
}
}