mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-18 12:36:34 +00:00
Improving production build
This commit is contained in:
parent
eff91fc991
commit
b69a90cbc7
@ -2,6 +2,7 @@ const autoprefixer = require('autoprefixer');
|
|||||||
const cssvars = require('postcss-simple-vars');
|
const cssvars = require('postcss-simple-vars');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
|
||||||
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
const ManifestPlugin = require('webpack-manifest-plugin');
|
const ManifestPlugin = require('webpack-manifest-plugin');
|
||||||
@ -74,8 +75,40 @@ module.exports = {
|
|||||||
// You can exclude the *.map files from the build during deployment.
|
// You can exclude the *.map files from the build during deployment.
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
// In production, we only want to load the polyfills and the app code.
|
// In production, we only want to load the polyfills and the app code.
|
||||||
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
// we specify a custom UglifyJsPlugin here to get source maps in production
|
||||||
|
new UglifyJSPlugin({
|
||||||
|
uglifyOptions: {
|
||||||
|
output: {
|
||||||
|
comments: false
|
||||||
|
},
|
||||||
|
compress: {
|
||||||
|
unsafe_comps: true,
|
||||||
|
properties: true,
|
||||||
|
keep_fargs: false,
|
||||||
|
pure_getters: true,
|
||||||
|
collapse_vars: true,
|
||||||
|
warnings: false,
|
||||||
|
sequences: true,
|
||||||
|
dead_code: true,
|
||||||
|
drop_debugger: true,
|
||||||
|
comparisons: true,
|
||||||
|
conditionals: true,
|
||||||
|
evaluate: true,
|
||||||
|
booleans: true,
|
||||||
|
loops: true,
|
||||||
|
unused: true,
|
||||||
|
hoist_funs: true,
|
||||||
|
if_return: true,
|
||||||
|
join_vars: true,
|
||||||
|
drop_console: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
},
|
||||||
entry: [
|
entry: [
|
||||||
"babel-polyfill",
|
|
||||||
require.resolve('./polyfills'),
|
require.resolve('./polyfills'),
|
||||||
paths.appIndexJs
|
paths.appIndexJs
|
||||||
],
|
],
|
||||||
@ -107,7 +140,7 @@ module.exports = {
|
|||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.(js|jsx)$/,
|
test: /\.(js|jsx)$/,
|
||||||
exclude: /node_modules/,
|
include: paths.appSrc,
|
||||||
use: {
|
use: {
|
||||||
loader: "babel-loader"
|
loader: "babel-loader"
|
||||||
}
|
}
|
||||||
@ -135,20 +168,6 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// JSON is not enabled by default in Webpack but both Node and Browserify
|
|
||||||
// allow it implicitly so we also enable it.
|
|
||||||
{
|
|
||||||
test: /\.json$/,
|
|
||||||
loader: 'json-loader'
|
|
||||||
},
|
|
||||||
// "file" loader for svg
|
|
||||||
{
|
|
||||||
test: /\.svg$/,
|
|
||||||
loader: 'file-loader',
|
|
||||||
query: {
|
|
||||||
name: 'static/media/[name].[hash:8].[ext]'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
1
dist/index.html
vendored
1
dist/index.html
vendored
@ -1 +0,0 @@
|
|||||||
<!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <meta name=viewport content="width=device-width,initial-scale=1"> <link rel="shortcut icon" href=favicon.ico> <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700" rel=stylesheet> <link rel=stylesheet href="https://fonts.googleapis.com/icon?family=Material+Icons"> <title>Multisig Safe</title> </head> <body> <div id=root></div> <script type="text/javascript" src="main.js"></script></body> </html>
|
|
159781
dist/main.js
vendored
159781
dist/main.js
vendored
File diff suppressed because one or more lines are too long
1
dist/main.js.map
vendored
1
dist/main.js.map
vendored
File diff suppressed because one or more lines are too long
@ -48,6 +48,7 @@
|
|||||||
"style-loader": "^0.20.2",
|
"style-loader": "^0.20.2",
|
||||||
"truffle-contract": "^3.0.4",
|
"truffle-contract": "^3.0.4",
|
||||||
"truffle-solidity-loader": "0.0.8",
|
"truffle-solidity-loader": "0.0.8",
|
||||||
|
"uglifyjs-webpack-plugin": "^1.2.2",
|
||||||
"webpack": "^4.0.0",
|
"webpack": "^4.0.0",
|
||||||
"webpack-cli": "^2.0.8",
|
"webpack-cli": "^2.0.8",
|
||||||
"webpack-dev-server": "^3.1.0",
|
"webpack-dev-server": "^3.1.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user