webpack.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // webpack.config.js
  2. const webpack = require('webpack');
  3. module.exports = {
  4. // entry point of our application
  5. entry: './main.js',
  6. // where to place the compiled bundle
  7. output: {
  8. path: __dirname + '/build/',
  9. filename: 'bundle.js'
  10. },
  11. module: {
  12. preLoaders: [
  13. {
  14. test: /\.vue$/,
  15. loader: 'eslint',
  16. exclude: /node_modules/
  17. }
  18. ],
  19. // `loaders` is an array of loaders to use.
  20. loaders: [
  21. {
  22. test: /\.vue$/, // a regex for matching all files that end in `.vue`
  23. loader: 'vue' // loader to use for matched files,
  24. },
  25. {
  26. test: /\.js$/, // a regex for matching all files that end in `.js`
  27. loader: 'babel', // loader to use for matched files,
  28. exclude: /node_modules/ // excludes the folder `node_modules`
  29. },
  30. {
  31. test: /\.scss$/, // a regex for matching all files that end in `.scss`
  32. loader: "css-loader!sass-loader" // loader to use for matched files,
  33. }
  34. ]
  35. },
  36. babel: {
  37. presets: ['es2015'],
  38. plugins: ['transform-runtime'],
  39. comments: false
  40. },
  41. plugins: [
  42. new webpack.optimize.UglifyJsPlugin()
  43. ]
  44. };