1st version of Working Game

This commit is contained in:
Sazzad-PC 2019-09-19 14:13:37 +06:00
commit 70abaf9d08
66 changed files with 8305 additions and 0 deletions

38
webpack/base.js Normal file
View file

@ -0,0 +1,38 @@
const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
module.exports = {
mode: "development",
devtool: "eval-source-map",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: [/\.vert$/, /\.frag$/],
use: "raw-loader"
},
{
test: /\.(gif|png|jpe?g|svg|xml)$/i,
use: "file-loader"
}
]
},
plugins: [
new webpack.DefinePlugin({
"typeof PLUGIN_FBINSTANT": JSON.stringify(true),
CANVAS_RENDERER: JSON.stringify(true),
WEBGL_RENDERER: JSON.stringify(true),
}),
new HtmlWebpackPlugin({
template: "./index.html"
})
]
};

27
webpack/prod.js Normal file
View file

@ -0,0 +1,27 @@
const merge = require("webpack-merge");
const path = require("path");
const base = require("./base");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = merge(base, {
mode: "production",
output: {
filename: "bundle.min.js"
},
devtool: false,
performance: {
maxEntrypointSize: 900000,
maxAssetSize: 900000
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false
}
}
})
]
}
});