Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

48 lignes
1.9 KiB

  1. const webpack = require('webpack');
  2. const path = require('path');
  3. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. const OptimizeCssAssetsPlugin = require('optimize-css-assets-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. {test: /\.scss$/, loader: ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader', publicPath: ''})},
  24. {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  25. {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  26. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'},
  27. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'},
  28. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=image/svg+xml'},
  29. ]
  30. },
  31. plugins: [
  32. new ExtractTextPlugin('lesspass.min.css')
  33. ]
  34. };
  35. if (process.env.NODE_ENV === 'production') {
  36. module.exports.devtool = false;
  37. module.exports.plugins = (module.exports.plugins || []).concat([
  38. new OptimizeCssAssetsPlugin(),
  39. new webpack.optimize.UglifyJsPlugin({
  40. output: {comments: false},
  41. compress: {warnings: false}
  42. })
  43. ]);
  44. }