rike422/loose-leaf

View on GitHub
client/webpack.config.prod.js

Summary

Maintainability
A
2 hrs
Test Coverage
const path = require('path')
const webpack = require('webpack')

const PATHS = {
  app: path.resolve(__dirname, './src')
}

module.exports = {

  entry: {
    index: './src/loose-leaf/index.js'
  },

  plugins: [
    new webpack.optimize.DedupePlugin(),
    new webpack.optimize.UglifyJsPlugin(),
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.AggressiveMergingPlugin(),
    new webpack.NoErrorsPlugin()
  ],
  externals: {
    'react': 'React'
  },

  resolve: {
    extensions: ['', '.js', '.jsx', '.js.flow'],
    modulesDirectories: [
      __dirname,
      '../node_modules',
      PATHS.app
    ],
    root: [path.resolve('src')]
  },

  module: {
    preLoaders: [
      {
        test: /\.(js|jsx|js\.flow)$/,
        loader: 'standard',
        exclude: /(node_modules)/,
        include: [
          path.resolve('src'),
          path.resolve('test')
        ]
      }
    ],
    loaders: [
      {
        test: /\.(js|jsx|js\.flow)$/,
        exclude: /(node_modules)/,
        loaders: [
          'babel-loader'
        ]
      }
    ]
  }
}