webpack.config.js 924 B

12345678910111213141516171819202122232425262728293031323334353637
  1. var path = require('path')
  2. module.exports = {
  3. entry: path.resolve('proj/index.js'),
  4. output: {
  5. path: path.resolve('static/src'),
  6. filename: 'main.js'
  7. },
  8. resolve: {
  9. extensions: ['.js', '.vue', '.json'],
  10. alias: {
  11. 'vue$': 'vue/dist/vue.esm.js',
  12. '@': path.resolve('proj')
  13. }
  14. },
  15. module: {
  16. rules: [
  17. {
  18. test: /\.vue$/,
  19. loader: 'vue-loader'
  20. },
  21. {
  22. test: /\.js$/,
  23. exclude: /node_modules/,
  24. loader: 'babel-loader'
  25. },
  26. {
  27. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  28. loader: 'url-loader',
  29. options: {
  30. limit: 10000,
  31. name: path.posix.join('static', 'img/[name].[hash:7].[ext]')
  32. }
  33. }
  34. ]
  35. }
  36. }