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.
 
 
 
 
 
 

59 rivejä
2.1 KiB

  1. var webpack = require('webpack');
  2. var path = require('path');
  3. var ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. var UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
  5. module.exports = {
  6. entry: {
  7. app: './src/main.js',
  8. },
  9. output: {
  10. path: path.resolve(__dirname, './dist'),
  11. publicPath: '/dist/',
  12. filename: 'lesspass.min.js'
  13. },
  14. resolve: {
  15. extensions: ['.json', '.js']
  16. },
  17. module: {
  18. rules: [
  19. {test: /\.vue$/, loader: 'vue-loader'},
  20. {test: /\.js$/, include: [path.resolve(__dirname, './src')], loader: 'babel-loader'},
  21. {test: /\.json/, loader: 'json-loader'},
  22. {test: /\.(png|jpg|jpeg|gif)$/, loader: 'file-loader?name=[name].[ext]'},
  23. {
  24. test: /\.css$/,
  25. loader: ExtractTextPlugin.extract({
  26. fallbackLoader: 'style-loader',
  27. loader: 'css-loader',
  28. publicPath: ''
  29. })
  30. },
  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('lesspass.min.css')
  40. ],
  41. devtool: '#eval-source-map'
  42. };
  43. if (process.env.NODE_ENV === 'production') {
  44. module.exports.devtool = false;
  45. module.exports.plugins = (module.exports.plugins || []).concat([
  46. new webpack.optimize.DedupePlugin(),
  47. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
  48. new webpack.optimize.UglifyJsPlugin({
  49. compress: {
  50. warnings: false
  51. }
  52. }),
  53. new UnminifiedWebpackPlugin()
  54. ]);
  55. }