Newer
Older
'use strict'
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const { target } = require('cozy-scripts/config/webpack.vars')
module.exports = {
mode: 'none',
plugins: [
// use a hash as chunk id to avoid id changes of not changing chunk
new webpack.HashedModuleIdsPlugin(),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'), // to compile on production mode (redux)
__DEVELOPMENT__: false,
__DEVTOOLS__: false,
__STACK_ASSETS__: target !== 'mobile',
__PIWIK_TRACKER_URL__: JSON.stringify('https://statweb.grandlyon.com/'),
__PIWIK_SITEID__: 117,
__SAU_LINK__: JSON.stringify(
'https://portail-citoyen-sau.guichet-recette.grandlyon.com/ecolyo/'
),
__SAU_IDEA_DIRECT_LINK__: JSON.stringify(
'https://demarches-sau.guichet-recette.grandlyon.com/retour-ecolyo/ecolyo-une-idee/'
),
__SAU_ISSUE_DIRECT_LINK__: JSON.stringify(
'https://demarches-sau.guichet-recette.grandlyon.com/retour-ecolyo/ecolyo-un-probleme/'
),
__SENTRY_DSN__: JSON.stringify(
'https://c868f6010f3f431d95be8f70d7f37666@grandlyon.errors.cozycloud.cc/6'
),
}),
],
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
// To fix a SAfari 10 bug : https://github.com/zeit/next.js/issues/5630
terserOptions: {
safari10: true,
},
}),
],
},
}