mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Define the proper NODE_ENV environment during running the webpack.
Using the webpack.DefinePlugin during the development build too, not just in production build. Fixes #2596. Also - passing option 'warning: false' for UglifyJsPlugin, which will not show warning messages on the console during the production build.
This commit is contained in:
parent
eae6f0427c
commit
2945b3fe93
@ -7,7 +7,7 @@ const sourceDir = __dirname + '/pgadmin/static';
|
||||
// and other util function used in CommonsChunksPlugin.
|
||||
const webpackShimConfig = require('./webpack.shim');
|
||||
const PRODUCTION = process.env.NODE_ENV === 'production';
|
||||
const envType = PRODUCTION ? 'prod': 'dev';
|
||||
const envType = PRODUCTION ? 'production': 'development';
|
||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const extractStyle = new ExtractTextPlugin('style.css');
|
||||
@ -54,7 +54,7 @@ const providePlugin = new webpack.ProvidePlugin({
|
||||
const uglifyPlugin = new webpack.optimize.UglifyJsPlugin({
|
||||
output: {comments: false},
|
||||
compress: {
|
||||
warnings: true,
|
||||
warnings: false,
|
||||
unused: true,
|
||||
dead_code: true,
|
||||
drop_console: true,
|
||||
@ -74,7 +74,7 @@ const optimizeAssetsPlugin = new OptimizeCssAssetsPlugin({
|
||||
// based on 'NODE_ENV' variable. [used only in production]
|
||||
const definePlugin = new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'NODE_ENV': JSON.stringify('production'),
|
||||
'NODE_ENV': JSON.stringify(envType),
|
||||
},
|
||||
});
|
||||
|
||||
@ -323,6 +323,7 @@ module.exports = {
|
||||
vendorChunks,
|
||||
pgAdminCommonChunks,
|
||||
providePlugin,
|
||||
definePlugin,
|
||||
hardSourceWebpackPlugin,
|
||||
sourceMapDevToolPlugin,
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user