Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9345670
webpack.config.production.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
webpack.config.production.js
View Options
/**
* Copyright (C) 2018-2019 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
// webpack configuration for compiling static assets in production mode
// import required webpack plugins
const
TerserPlugin
=
require
(
'terser-webpack-plugin'
);
const
OptimizeCSSAssetsPlugin
=
require
(
'optimize-css-assets-webpack-plugin'
);
// import webpack development configuration
var
webpackProdConfig
=
require
(
'./webpack.config.development'
);
// override mode to production
webpackProdConfig
.
mode
=
'production'
;
// configure minimizer for js and css assets
webpackProdConfig
.
optimization
.
minimizer
=
[
// use terser for minimizing js and generate source map files
new
TerserPlugin
({
cache
:
true
,
parallel
:
true
,
sourceMap
:
true
}),
// use cssnano for minimizing css and generate source map files
new
OptimizeCSSAssetsPlugin
({
cssProcessorOptions
:
{
map
:
{
inline
:
false
,
annotation
:
true
},
minifyFontValues
:
false
,
discardUnused
:
false
,
zindex
:
false
}
})
];
// prevent modules concatenation for generating weblabels
webpackProdConfig
.
optimization
.
concatenateModules
=
false
;
// webpack production configuration
module
.
exports
=
webpackProdConfig
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 3:28 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3368839
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment