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.
|
|
|
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
|
|
filename: 'main.js',
|
|
|
|
path: path.resolve(__dirname, 'dist')
|
|
|
|
},
|
|
|
|
|
|
|
|
devServer: {
|
|
|
|
port: 6001,
|
|
|
|
hot: true
|
|
|
|
},
|
|
|
|
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['@babel/preset-env']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
title: '游戏窗体模板',
|
|
|
|
template: 'public/index.html',
|
|
|
|
inject: 'body',
|
|
|
|
})
|
|
|
|
],
|
|
|
|
}
|