代码拉取完成,页面将自动刷新
同步操作将从 jsmask/跳一跳H5版 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const commonConfig = {
entry: {
three: './public/three.js',
main: './app.js'
},
output: {
path: path.resolve(__dirname, "./dist"),
chunkFilename: '[name].bundle.js',
filename: chunkData => chunkData.chunk.name === 'main' ? '[name].[chunkhash:12].js' : '[name].min.js',
},
resolve: {
alias: {
'@': path.resolve(__dirname, "./"),
"@css": '@/public/css',
"@images": '@/public/images',
"@fonts": '@/public/fonts',
"@src": "@/src",
"@game": "@src/game",
"@stage": "@src/stage",
"@utils": "@src/utils",
"@scene": "@src/scene",
"@block": "@src/block",
"@part": "@src/part",
"@audio": "@/public/audio"
}
},
devtool: "cheap-module-eval-source-map",
devServer: {
contentBase: "./dist",
port: 8085,
open: true
},
module: {
rules: [{
test: /\.(mp3|mp4|ogg)$/,
use: {
loader: "file-loader",
options: {
name: "[name].[hash:8].[ext]",
outputPath: "audio/"
}
}
}, {
test: /\.(jpe?g|gif|svg|png)$/,
use: {
loader: "file-loader",
options: {
name: "[name].[hash:8].[ext]",
outputPath: "images/"
}
}
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader']
}, {
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader",
options: {
plugins: ['@babel/plugin-proposal-class-properties'],
presets: [[
'@babel/preset-env', {
targets: {
chrome: 58,
},
useBuiltIns: "usage",
corejs: 2
}
]]
}
}
}]
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
title: "跳一跳H5",
favicon: "./public/favicon.ico",
filename: "index.html",
template: "./public/index.html",
minify: {
removeComments: true,
collapseWhitespace: true,
minifyCSS: true
},
})
],
optimization: {
splitChunks: {
chunks: 'all'
}
},
}
module.exports = commonConfig;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。