修改过页面
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.

106 lines
2.9 KiB

1 year ago
  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. app: ['babel-polyfill','./src/main.js']
  14. },
  15. output: {
  16. path: config.build.assetsRoot,
  17. filename: '[name].js',
  18. publicPath: process.env.NODE_ENV === 'production' ?
  19. config.build.assetsPublicPath :
  20. config.dev.assetsPublicPath
  21. },
  22. resolve: {
  23. extensions: ['.js', '.vue', '.json'],
  24. alias: {
  25. 'vue$': 'vue/dist/vue.esm.js',
  26. '@': resolve('src'),
  27. 'jquery': path.resolve(__dirname, '../node_modules/jquery/src/jquery')
  28. }
  29. },
  30. module: {
  31. rules: [{
  32. test: /\.vue$/,
  33. loader: 'vue-loader',
  34. options: vueLoaderConfig
  35. },
  36. {
  37. test: /\.js$/,
  38. loader: 'babel-loader',
  39. include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
  40. },
  41. {
  42. test: /\.js$/,
  43. loader: 'babel-loader',
  44. include: [resolve('src'), resolve('test'), resolve('node_modules/@jiaminghi/data-view/lib')]
  45. },
  46. {
  47. test: /\.js$/,
  48. loader: 'babel-loader',
  49. include: [resolve('src'),resolve('test'),resolve('node_modules/element-ui/src'),resolve('/node_modules/element-ui/packages')
  50. ]
  51. },
  52. {
  53. test: /\.js$/,
  54. loader: 'babel-loader',
  55. include: [resolve('src'),resolve('test'),resolve('node_modules/element-ui/src'),resolve('/node_modules/vue-baidu-map/components/base')
  56. ]
  57. },
  58. {
  59. test: /\.js$/,
  60. loader: 'babel-loader',
  61. include: [resolve('src'),resolve('test'),resolve('node_modules/js-base64')
  62. ]
  63. },
  64. {
  65. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  66. loader: 'url-loader',
  67. options: {
  68. limit: 10000,
  69. name: utils.assetsPath('img/[name].[hash:7].[ext]')
  70. }
  71. },
  72. {
  73. test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
  74. loader: 'url-loader',
  75. options: {
  76. limit: 10000,
  77. name: utils.assetsPath('media/[name].[hash:7].[ext]')
  78. }
  79. },
  80. {
  81. test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
  82. loader: 'url-loader',
  83. options: {
  84. limit: 10000,
  85. name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
  86. }
  87. }
  88. ]
  89. },
  90. node: {
  91. // prevent webpack from injecting useless setImmediate polyfill because Vue
  92. // source contains it (although only uses it if it's native).
  93. setImmediate: false,
  94. // prevent webpack from injecting mocks to Node native modules
  95. // that does not make sense for the client
  96. dgram: 'empty',
  97. fs: 'empty',
  98. net: 'empty',
  99. tls: 'empty',
  100. child_process: 'empty'
  101. }
  102. }