Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

61 rader
2.2 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. var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
  6. module.exports = {
  7. entry: {
  8. app: './src/main.js',
  9. },
  10. output: {
  11. path: path.resolve(__dirname, './dist'),
  12. publicPath: '/dist/',
  13. filename: 'lesspass.min.js'
  14. },
  15. resolve: {
  16. extensions: ['.json', '.js']
  17. },
  18. module: {
  19. rules: [
  20. {test: /\.vue$/, loader: 'vue-loader'},
  21. {test: /\.js$/, include: [path.resolve(__dirname, './src')], loader: 'babel-loader'},
  22. {test: /\.json/, loader: 'json-loader'},
  23. {test: /\.(png|jpg|jpeg|gif)$/, loader: 'file-loader?name=[name].[ext]'},
  24. {
  25. test: /\.css$/,
  26. loader: ExtractTextPlugin.extract({
  27. fallbackLoader: 'style-loader',
  28. loader: 'css-loader',
  29. publicPath: ''
  30. })
  31. },
  32. {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  33. {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  34. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'},
  35. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'},
  36. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=image/svg+xml'},
  37. ]
  38. },
  39. plugins: [
  40. new ExtractTextPlugin('lesspass.min.css')
  41. ],
  42. devtool: '#eval-source-map'
  43. };
  44. if (process.env.NODE_ENV === 'production') {
  45. module.exports.devtool = false;
  46. module.exports.plugins = (module.exports.plugins || []).concat([
  47. new OptimizeCssAssetsPlugin(),
  48. new webpack.optimize.DedupePlugin(),
  49. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
  50. new webpack.optimize.UglifyJsPlugin({
  51. compress: {
  52. warnings: false
  53. }
  54. }),
  55. new UnminifiedWebpackPlugin()
  56. ]);
  57. }