您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

76 行
1.6 KiB

  1. 'use strict'
  2. const path = require('path')
  3. const utils = require('./utils')
  4. const config = require('../config')
  5. const vueLoaderConfig = require('./vue-loader.conf')
  6. function resolve (dir) {
  7. return path.join(__dirname, '..', dir)
  8. }
  9. module.exports = {
  10. context: path.resolve(__dirname, '../'),
  11. entry: {
  12. app: './src/main.js'
  13. },
  14. output: {
  15. path: config.build.assetsRoot,
  16. filename: '[name].js',
  17. publicPath: process.env.NODE_ENV === 'production'
  18. ? config.build.assetsPublicPath
  19. : config.dev.assetsPublicPath
  20. },
  21. resolve: {
  22. extensions: ['.js', '.vue', '.json'],
  23. alias: {
  24. 'vue$': 'vue/dist/vue.esm.js',
  25. '@': resolve('src'),
  26. }
  27. },
  28. module: {
  29. rules: [
  30. {
  31. test: /\.sass$/,
  32. loader:'style!css!sass'
  33. },
  34. {
  35. test: /\.vue$/,
  36. loader: 'vue-loader',
  37. options: vueLoaderConfig
  38. },
  39. {
  40. test: /\.js$/,
  41. loader: 'babel-loader',
  42. include: [resolve('src'), resolve('test')]
  43. },
  44. {
  45. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  46. loader: 'url-loader',
  47. options: {
  48. limit: 10000,
  49. name: utils.assetsPath('img/[name].[hash:7].[ext]')
  50. }
  51. },
  52. {
  53. test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
  54. loader: 'url-loader',
  55. options: {
  56. limit: 10000,
  57. name: utils.assetsPath('media/[name].[hash:7].[ext]')
  58. }
  59. },
  60. {
  61. test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
  62. loader: 'url-loader',
  63. options: {
  64. limit: 10000,
  65. name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
  66. }
  67. }
  68. ]
  69. }
  70. }