UNPKG

@zalando/zally-web-ui

Version:
48 lines (46 loc) 1.81 kB
const webpack = require('webpack'); const merge = require('webpack-merge'); const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') .BundleAnalyzerPlugin; const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const common = require('./common.js'); module.exports = merge(common, { devtool: 'source-map', plugins: [ new UglifyJSPlugin({ uglifyOptions: { ie8: false, ecma: 8, warnings: false, }, sourceMap: true, }), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production'), }), new BundleAnalyzerPlugin({ // Can be `server`, `static` or `disabled`. // In `server` mode analyzer will start HTTP server to show bundle report. // In `static` mode single HTML file with bundle report will be generated. // In `disabled` mode you can use this plugin to just generate Webpack Stats JSON file by setting `generateStatsFile` to `true`. analyzerMode: 'static', // Path to bundle report file that will be generated in `static` mode. // Relative to bundles output directory. reportFilename: '../../../../target/report.html', defaultSizes: 'gzip', // Automatically open report in default browser openAnalyzer: false, // If `true`, Webpack Stats JSON file will be generated in bundles output directory generateStatsFile: true, // Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`. // Relative to bundles output directory. statsFilename: '../../../../target/stats.json', // Options for `stats.toJson()` method. statsOptions: { source: false, }, // Log level. Can be 'info', 'warn', 'error' or 'silent'. logLevel: 'info', }), ], });