Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

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