vue.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const { defineConfig } = require('@vue/cli-service')
  2. const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
  3. const path = require('path')
  4. function resolve(dir) {
  5. return path.join(__dirname, dir)
  6. }
  7. module.exports = defineConfig({
  8. transpileDependencies: true,
  9. publicPath: "/",
  10. lintOnSave:false,
  11. transpileDependencies: true,
  12. productionSourceMap: false,
  13. devServer: {
  14. port: 1090,
  15. // proxy: {
  16. // '/infoapi': {
  17. // target: 'https://info.jiduzq.com/v1/',
  18. // changeOrigin: true,
  19. // pathRewrite: {
  20. // '^/infoapi': '/'
  21. // }
  22. // },
  23. // }
  24. },
  25. configureWebpack: {
  26. // provide the app's title in webpack's name field, so that
  27. // it can be accessed in index.html to inject the correct title.
  28. name: 'name',
  29. resolve: {
  30. alias: {
  31. '@': resolve('src')
  32. },
  33. fallback: {
  34. //其他的如果不启用可以用 keyname :false,例如:crypto:false,
  35. "crypto": require.resolve("crypto-browserify"),
  36. "stream": require.resolve("stream-browserify")
  37. },
  38. },
  39. plugins: [new NodePolyfillPlugin()]
  40. },
  41. })