You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 line
724 B

  1. 'use strict'
  2. const webpack = require('webpack')
  3. const env = process.env.NODE_ENV
  4. const isDev = env === 'development'
  5. const isTest = env === 'test'
  6. const isProd = env === 'production'
  7. const plugins = [
  8. new webpack.DefinePlugin({
  9. 'process.env.NODE_ENV': JSON.stringify(env),
  10. __DEV__: isDev,
  11. __TEST__: isTest
  12. })
  13. ]
  14. if (isProd) {
  15. plugins.push(new webpack.optimize.UglifyJsPlugin({
  16. compress: {
  17. warnings: false
  18. }
  19. }))
  20. }
  21. module.exports = {
  22. output: {
  23. library: 'jssVendorPrefixer',
  24. libraryTarget: 'umd'
  25. },
  26. plugins,
  27. module: {
  28. loaders: [
  29. {
  30. loader: 'babel-loader',
  31. test: /\.js$/,
  32. exclude: /node_modules/
  33. }
  34. ]
  35. },
  36. devtool: 'source-map'
  37. }