Guest User

Untitled

a guest
Nov 20th, 2016
1,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  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 webpack.optimize.DedupePlugin(),
  27. new ExtractTextPlugin('styles.css', {
  28. allChunks: true
  29. }),
  30. new webpack.optimize.UglifyJsPlugin()
  31. ],
  32. module: {
  33. loaders: [
  34. {test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['babel']},
  35. {test: /(\.css)$/,
  36. loader: ExtractTextPlugin.extract("style-loader", "css-loader"),
  37. include: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'src/static') ]
  38. },
  39. {test: /(\.css)$/,
  40. loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'),
  41. exclude: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'src/static') ]
  42. },
  43. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
  44. {test: /\.(woff|woff2)$/, loader: "url?prefix=font/&limit=5000"},
  45. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
  46. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}
  47. ]
  48. },
  49. postcss: [
  50. require('autoprefixer'),
  51. require('postcss-color-rebeccapurple')
  52. ]
  53. };
Add Comment
Please, Sign In to add comment