You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

58 regels
1.2 KiB

  1. var path = require('path')
  2. var utils = require('./utils')
  3. var config = require('../config')
  4. var vueLoaderConfig = require('./vue-loader.conf')
  5. function resolve (dir) {
  6. return path.join(__dirname, '..', dir)
  7. }
  8. module.exports = {
  9. entry: {
  10. app: './src/main.js'
  11. },
  12. output: {
  13. path: config.build.assetsRoot,
  14. filename: '[name].js',
  15. publicPath: process.env.NODE_ENV === 'production'
  16. ? config.build.assetsPublicPath
  17. : config.dev.assetsPublicPath
  18. },
  19. resolve: {
  20. extensions: ['.js', '.vue', '.json'],
  21. alias: {
  22. '@': resolve('src')
  23. }
  24. },
  25. module: {
  26. rules: [
  27. {
  28. test: /\.vue$/,
  29. loader: 'vue-loader',
  30. options: vueLoaderConfig
  31. },
  32. {
  33. test: /\.js$/,
  34. loader: 'babel-loader',
  35. include: [resolve('src'), resolve('test')]
  36. },
  37. {
  38. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  39. loader: 'url-loader',
  40. options: {
  41. limit: 10000,
  42. name: utils.assetsPath('img/[name].[hash:7].[ext]')
  43. }
  44. },
  45. {
  46. test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
  47. loader: 'url-loader',
  48. options: {
  49. limit: 10000,
  50. name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
  51. }
  52. }
  53. ]
  54. }
  55. }