Sha256: f8356d8e88fdfdc681e9b52c2a9d5f0c01ea1d5dcbc7d4e6f1803725759838f9

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

const webpack = require('webpack')
const CompressionPlugin = require('compression-webpack-plugin')
const Environment = require('../environment')

module.exports = class extends Environment {
  constructor() {
    super()

    this.plugins.set('ModuleConcatenation', new webpack.optimize.ModuleConcatenationPlugin())

    this.plugins.set('UglifyJs', new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
        warnings: false
      },
      output: {
        comments: false
      }
    }))

    this.plugins.set('Compression', new CompressionPlugin({
      asset: '[path].gz[query]',
      algorithm: 'gzip',
      test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/
    }))
  }

  toWebpackConfig() {
    const result = super.toWebpackConfig()
    result.devtool = 'nosources-source-map'
    result.stats = 'normal'
    return result
  }
}

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/@rails/webpacker/package/environments/production.js
webpacker-3.0.2 package/environments/production.js