mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
feat(phone/webpack): Allow for use of react-devtools in game
This is dynamically added to the bundle depending on the environment. In production, react-devtools will not be bundled. Build a development bundle using `yarn build:dev`
This commit is contained in:
1 parent
eaf27f37ef
commit
7b6d49f661
6 files changed
+730
-54
No files matched your search
@@ -0,0 +1,41 @@
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = require('./webpack.common')({
|
||||
mode: 'production',
|
||||
|
||||
entry: [path.join(process.cwd(), 'src/index.tsx')],
|
||||
|
||||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'public/index.html',
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeRedundantAttributes: true,
|
||||
useShortDoctype: true,
|
||||
removeEmptyAttributes: true,
|
||||
removeStyleLinkTypeAttributes: true,
|
||||
keepClosingSlash: true,
|
||||
minifyJS: true,
|
||||
minifyCSS: true,
|
||||
minifyURLs: true,
|
||||
},
|
||||
inject: true,
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: 'public/media',
|
||||
to: path.resolve(process.cwd(), '../resources/html/media'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
||||
performance: {
|
||||
assetFilter: (assetFilename) =>
|
||||
!/(\.map$)|(^(main\.|favicon\.))/.test(assetFilename),
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user