Browse Source

修改打包错误

master
xyiege 5 months ago
parent
commit
3bcffec1f6
  1. 3
      vue/afvue/package.json
  2. 10
      vue/afvue/vite.config.js

3
vue/afvue/package.json

@ -6,8 +6,7 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview --port 4173", "preview": "vite preview --port 4173"
"proto": "pbjs -t json-module -w commonjs -o src/proto/scinfo.js src/proto/scinfo.proto"
}, },
"dependencies": { "dependencies": {
"axios": "^1.11.0", "axios": "^1.11.0",

10
vue/afvue/vite.config.js

@ -1,17 +1,17 @@
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import legacy from '@vitejs/plugin-legacy' // import legacy from '@vitejs/plugin-legacy'
import vue2 from '@vitejs/plugin-vue2' import vue2 from '@vitejs/plugin-vue2'
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue2(), vue2(),
legacy({ // legacy({
targets: ['ie >= 11'], // targets: ['ie >= 11'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'] // additionalLegacyPolyfills: ['regenerator-runtime/runtime']
}) // })
], ],
resolve: { resolve: {
alias: { alias: {

Loading…
Cancel
Save