webpack.config.js 1.1 KB

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