Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

67 wiersze
2.3 KiB

  1. var webpack = require('webpack');
  2. var path = require('path');
  3. var ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. module.exports = {
  5. entry: './src/main.js',
  6. output: {
  7. path: path.resolve(__dirname, './dist'),
  8. publicPath: '/dist/',
  9. filename: 'bundle.js'
  10. },
  11. resolve: {
  12. extensions: ['', '.js', '.vue'],
  13. fallback: [path.join(__dirname, 'node_modules')],
  14. alias: {
  15. src: path.resolve(__dirname, './src'),
  16. jquery: 'jquery/src/jquery'
  17. }
  18. },
  19. resolveLoader: {
  20. root: path.join(__dirname, 'node_modules')
  21. },
  22. module: {
  23. loaders: [
  24. {test: /\.vue$/, loader: 'vue-loader'},
  25. {test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'},
  26. {test: /\.(png|jpg|jpeg|gif)$/, loader: 'url?limit=10000&name=images/[name].[ext]',},
  27. {test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')},
  28. {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
  29. {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff"},
  30. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream"},
  31. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"},
  32. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml"},
  33. ]
  34. },
  35. plugins: [
  36. new ExtractTextPlugin('styles.css'),
  37. new webpack.ProvidePlugin({
  38. $: 'jquery',
  39. jQuery: 'jquery',
  40. 'window.jQuery': 'jquery',
  41. 'window.Tether': 'tether'
  42. })
  43. ],
  44. devtool: '#eval-source-map'
  45. };
  46. if (process.env.NODE_ENV === 'production') {
  47. module.exports.devtool = false;
  48. module.exports.output.publicPath = '';
  49. module.exports.plugins = (module.exports.plugins || []).concat([
  50. new webpack.optimize.DedupePlugin(),
  51. new webpack.optimize.OccurrenceOrderPlugin(),
  52. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
  53. new webpack.optimize.UglifyJsPlugin({
  54. compress: {
  55. warnings: true
  56. },
  57. output: {
  58. comments: false
  59. },
  60. sourceMap: false
  61. })
  62. ]);
  63. }