vue.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. const webpack = require('webpack')
  2. const { defineConfig } = require('@vue/cli-service')
  3. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
  4. process.env.VUE_APP_VERSION = require('./package.json').version
  5. module.exports = defineConfig({
  6. transpileDependencies: true,
  7. // publicPath: process.env.NODE_ENV === 'development' ? '/' : '/',
  8. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/YHTM/',
  9. productionSourceMap: process.env.CLI_MODE === 'prod' ? false : true,
  10. configureWebpack: {
  11. module: {
  12. rules: [
  13. {
  14. test: /\.cur$/,
  15. use: {
  16. loader: 'file-loader'
  17. }
  18. }
  19. ]
  20. },
  21. plugins: [
  22. new webpack.ProvidePlugin({
  23. // utils: ['/src/utils.js', 'default']
  24. globalMapState: ['vuex', 'mapState'],
  25. globalMapMutations: ['vuex', 'mapMutations'],
  26. globalMapGetters: ['vuex', 'mapGetters'],
  27. globalConfig: ['/src/config.js', 'default'],
  28. globalApi: ['/src/api.js', 'default'],
  29. globalUtils: ['/src/utils.js', 'default'],
  30. }),
  31. new NodePolyfillPlugin()
  32. ],
  33. },
  34. })