25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

58 satır
2.1 KiB

  1. var webpack = require('webpack');
  2. var path = require('path');
  3. var ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. var purify = require("purifycss-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. {test: /\.scss$/, loader: ExtractTextPlugin.extract({fallbackLoader: 'style-loader', loader: 'css-loader!sass-loader', publicPath: ''})},
  25. {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  26. {test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/font-woff'},
  27. {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=application/octet-stream'},
  28. {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader'},
  29. {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=8192&mimetype=image/svg+xml'},
  30. ]
  31. },
  32. plugins: [
  33. new ExtractTextPlugin('lesspass.min.css'),
  34. new purify({
  35. basePath: __dirname,
  36. paths: [
  37. "src/**/*.html",
  38. "src/**/*.vue"
  39. ]
  40. })
  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.UglifyJsPlugin({
  49. compress: {
  50. warnings: false
  51. }
  52. })
  53. ]);
  54. }