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.
 
 
 
 
 
 

40 line
1.5 KiB

  1. var webpack = require('webpack');
  2. module.exports = {
  3. context: __dirname + "/app",
  4. entry: "./main.js",
  5. output: {
  6. path: __dirname + "/dist",
  7. publicPath: '/dist/',
  8. filename: "bundle.js"
  9. },
  10. module: {
  11. loaders: [
  12. {test: /\.js$/, loader: 'babel-loader', query: {presets: ['es2015']}},
  13. {test: /\.css$/, loader: 'style-loader!css-loader'},
  14. {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'},
  15. {test: /\.vue$/, loader: 'vue'},
  16. {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
  17. {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
  18. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
  19. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
  20. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"}
  21. ]
  22. },
  23. plugins: [
  24. new webpack.ProvidePlugin({
  25. $: "jquery",
  26. jQuery: "jquery",
  27. "window.jQuery": "jquery"
  28. })
  29. ]
  30. };
  31. if (process.env.NODE_ENV === 'production') {
  32. module.exports.plugins = [
  33. new webpack.DefinePlugin({'process.env': {NODE_ENV: '"production"'}}),
  34. new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}, comments: false}),
  35. new webpack.optimize.OccurenceOrderPlugin(),
  36. new webpack.optimize.DedupePlugin()
  37. ]
  38. }