Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import webpack from 'webpack';
  2. import path from 'path';
  3. import ExtractTextPlugin from 'extract-text-webpack-plugin';
  4.  
  5. const GLOBALS = {
  6.   'process.env.NODE_ENV': JSON.stringify('production')
  7. };
  8.  
  9. export default {
  10.   debug: true,
  11.   devtool: 'source-map',
  12.   noInfo: false,
  13.   entry: './src/index',
  14.   target: 'web',
  15.   output: {
  16.     path: __dirname + '/dist', // Note: Physical files are only output by the production build task `npm run build`.
  17.     publicPath: '/',
  18.     filename: 'bundle.js'
  19.   },
  20.   devServer: {
  21.     contentBase: './dist'
  22.   },
  23.   plugins: [
  24.     new webpack.optimize.OccurenceOrderPlugin(),
  25.     new webpack.DefinePlugin(GLOBALS),
  26.     new ExtractTextPlugin('styles.css'),
  27.     new webpack.optimize.DedupePlugin(),
  28.     new webpack.optimize.UglifyJsPlugin()
  29.   ],
  30.   module: {
  31.     loaders: [
  32.       {test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['babel']},
  33.       {test: /(\.css)$/, loader: ExtractTextPlugin.extract("css?sourceMap")},
  34.       {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
  35.       {test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000"},
  36.       {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
  37.       {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}
  38.     ]
  39.   }
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement