選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

31 行
607 B

  1. const webpack = require('webpack')
  2. const plugins = [
  3. new webpack.DefinePlugin({
  4. 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
  5. __DEV__: process.env.NODE_ENV === 'development',
  6. __TEST__: process.env.NODE_ENV === 'test'
  7. })
  8. ]
  9. if (process.env.NODE_ENV === 'production') {
  10. plugins.push(new webpack.optimize.UglifyJsPlugin())
  11. }
  12. module.exports = {
  13. output: {
  14. library: 'cssVendor',
  15. libraryTarget: 'umd'
  16. },
  17. plugins: plugins,
  18. module: {
  19. loaders: [
  20. {
  21. loader: 'babel-loader',
  22. test: /\.js$/,
  23. exclude: /node_modules/
  24. }
  25. ]
  26. }
  27. }