webpack.config.js 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. var path = require('path')
  2. var webpack = require('webpack')
  3. module.exports = {
  4. entry: './src/main.js',
  5. output: {
  6. path: path.resolve(__dirname, './dist'),
  7. publicPath: '/dist/',
  8. filename: 'vue-radial-progress.min.js',
  9. library: 'RadialProgressBar',
  10. libraryTarget: 'umd',
  11. umdNamedDefine: true
  12. },
  13. module: {
  14. loaders: [
  15. {
  16. test: /\.vue$/,
  17. loader: 'vue'
  18. },
  19. {
  20. test: /\.js$/,
  21. loader: 'babel',
  22. exclude: /node_modules/
  23. }
  24. ]
  25. },
  26. devtool: '#eval-source-map'
  27. }
  28. if (process.env.NODE_ENV === 'production') {
  29. module.exports.devtool = false
  30. module.exports.plugins = (module.exports.plugins || []).concat([
  31. new webpack.DefinePlugin({
  32. 'process.env': {
  33. NODE_ENV: '"production"'
  34. }
  35. }),
  36. new webpack.optimize.UglifyJsPlugin({
  37. compress: {
  38. warnings: false
  39. },
  40. sourceMap: false
  41. }),
  42. new webpack.optimize.OccurenceOrderPlugin()
  43. ])
  44. }