vue.config.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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.PUBLIC_PATH,
  8. productionSourceMap: process.env.VUE_APP_CLI_MODE === 'dev' ? true : false,
  9. configureWebpack: {
  10. module: {
  11. rules: [
  12. {
  13. test: /\.cur$/,
  14. use: {
  15. loader: 'file-loader'
  16. }
  17. }
  18. ]
  19. },
  20. plugins: [
  21. new webpack.ProvidePlugin({
  22. // utils: ['/src/utils.js', 'default']
  23. globalMapState: ['vuex', 'mapState'],
  24. globalMapMutations: ['vuex', 'mapMutations'],
  25. globalMapGetters: ['vuex', 'mapGetters'],
  26. globalConfig: ['/src/config.js', 'default'],
  27. globalApi: ['/src/api.js', 'default'],
  28. globalUtils: ['/src/utils.js', 'default'],
  29. }),
  30. new NodePolyfillPlugin()
  31. ],
  32. },
  33. })