webpack.config.js 991 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. babel: {
  36. presets: ['es2015'],
  37. plugins: ['transform-runtime']
  38. }
  39. };