vitejs / vite

Next generation frontend tooling. It's fast!
http://vite.dev
MIT License
68.69k stars 6.21k forks source link

Lost files after legacy transform #7784

Closed wht300 closed 2 years ago

wht300 commented 2 years ago

Describe the bug

top:Because the business code is not extracted temporarily, minimal Reproduction cannot be provided temporarily
I will try to provide minimal Reproduction later

Lost index-legacy.fffc75e3.js after NPM build in file my-reservation-legacy.8b8ccfbf.js

System.register([
  './vendor-legacy.eb654667.js',
  './index-legacy.fffc75e3.js', // this file was  lost
  './index-legacy.c9064487.js'], (function(e) {
  'use strict';
  var n, t, r, c, i, u;
  return {
    setters: [
      function(e) {n = e.S, t = e.r, r = e.o, c = e.i, i = e.a;},
      function() {},
      function(e) {u = e._;}],
    execute: function() {
      e('default', u({name: 'MyReservation', components: {Search: n}}, [
        [
          'render', function(e, n, u, a, o, s) {
          var f = t('Search');
          return r(), c('div', null, [i(f)]);
        }]]));
    },
  };
}));

dist file tree

│  favicon.ico
│  index.html
│
└─assets
        create-legacy.f9499fed.js
        create.8ac31c56.js
        index-legacy.c9064487.js
        index.4894fae1.js
        index.77e5712b.css
        index.b38b35b6.css
        my-reservation-legacy.8b8ccfbf.js
        my-reservation.a8f166fa.js
        polyfills-legacy.806568ef.js
        vendor-legacy.eb654667.js
        vendor.2b52bdd8.js
        vendor.584aabef.css

package.json

{
  "name": "vue-project",
  "version": "0.0.0",
  "scripts": {
    "dev": "vite --host",
    "build:STG": "cross-env VITE_APP_BUILD_ENV=STG vite build",
    "build:PROD": "cross-env VITE_APP_BUILD_ENV=PROD vite build",
    "preview": "vite preview --port 5050 --host"
  },
  "dependencies": {
    "@amap/amap-jsapi-loader": "^1.0.1",
    "@vueuse/core": "^7.4.1",
    "axios": "^0.24.0",
    "compressorjs": "^1.1.1",
    "crypto-js": "^4.1.1",
    "dayjs": "^1.10.7",
    "element-plus": "^1.3.0-beta.5",
    "less": "^4.1.2",
    "lodash": "^4.17.21",
    "numeral": "^2.0.6",
    "pinia": "^2.0.6",
    "sass": "^1.45.1",
    "size-sensor": "^1.0.1",
    "vant": "^3.4.4",
    "vue": "^3.2.26",
    "vue-demi": "^0.12.1",
    "vue-router": "^4.0.12"
  },
  "devDependencies": {
    "@vitejs/plugin-legacy": "^1.6.4",
    "@vitejs/plugin-vue": "^2.0.0",
    "@vitejs/plugin-vue-jsx": "^1.3.1",
    "cross-env": "^7.0.3",
    "eslint": "^8.5.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-vue": "^8.2.0",
    "postcss-preset-env": "^7.1.0",
    "prettier": "^2.5.1",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@2.1.4",
    "vite": "^2.7.1",
    "vite-plugin-style-import": "1.4.0",
    "vite-plugin-windicss": "^1.6.1",
    "windicss": "^3.4.0"
  }
}

vite.config.js

import { fileURLToPath } from 'url';
import WindiCSS from 'vite-plugin-windicss';
import { defineConfig, loadEnv } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import styleImport, { ElementPlusResolve } from 'vite-plugin-style-import';
import legacy from '@vitejs/plugin-legacy';
// https://vitejs.dev/config/
export default ({ mode }) => {
  const ENV = loadEnv(mode, process.cwd());
  return defineConfig({
    base: `/${ENV.VITE_BASE_URL}/`,
    plugins: [
      vue(),
      vueJsx(),
      styleImport({
        resolves: [ElementPlusResolve()],
        libs: [
          {
            libraryName: 'vant',
            esModule: true,
            resolveStyle: (name) => `vant/es/${name}/style/less.js`,
          },
        ],
      }),
      WindiCSS(),
      legacy({
        targets: ['Chrome >= 39'],
        additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
      }),
    ],
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('./src', import.meta.url)),
      },
    },
    build: {
      target: 'es2015',
    },
  });
};

Reproduction

https://stackblitz.com/edit/vitejs-vite-mbep4p?file=package.json&terminal=dev

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 6.05 GB / 19.85 GB
  Binaries:
    Node: 16.14.2 - ~\AppData\Local\Volta\tools\image\node\16.14.2\node.EXE
    Yarn: 1.22.18 - ~\AppData\Local\Volta\tools\image\yarn\1.22.18\bin\yarn.CMD
    npm: 8.6.0 - ~\node_modules\.bin\npm.CMD
  Browsers:
    Chrome: 100.0.4896.88
    Edge: Spartan (44.22000.120.0), Chromium (100.0.1185.39)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitejs/plugin-legacy: ^1.6.4 => 1.6.4
    @vitejs/plugin-vue: ^2.0.0 => 2.0.1
    @vitejs/plugin-vue-jsx: ^1.3.1 => 1.3.3
    vite: ^2.7.1 => 2.7.6

Used Package Manager

npm

Logs

  vite:config using resolved config: {
  vite:config   base: '/appointment-order/',
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite-plugin-windicss:alias',
  vite:config     'vite-plugin-windicss:groups',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-script-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:vue',
  vite:config     'vite:vue-jsx',
  vite:config     'vite-plugin-windicss',
  vite:config     'vite-plugin-windicss:css',
  vite:config     'vite-plugin-windicss:css:svelte',
  vite:config     'vite-plugin-windicss:devtools',
  vite:config     'vite:legacy-config',
  vite:config     'vite:legacy-generate-polyfill-chunk',
  vite:config     'vite:legacy-env',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:style-import',
  vite:config     'vite-plugin-windicss:entry',
  vite:config     'vite:legacy-post-process',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object], [Object] ] },
  vite:config   build: {
  vite:config     target: 'es2015',
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: 'chrome61',
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {
  vite:config       input: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\index.html',
  vite:config       output: [Array]
  vite:config     },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   define: {
  vite:config     __VUE_OPTIONS_API__: true,
  vite:config     __VUE_PROD_DEVTOOLS__: false,
  vite:config     'import.meta.env.LEGACY': '__VITE_IS_LEGACY__'
  vite:config   },
  vite:config   ssr: { external: [ 'vue', '@vue/server-renderer' ] },
  vite:config   esbuild: { include: /\.ts$/ },
  vite:config   configFile: 'C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/vite.config.js',
  vite:config   configFileDependencies: [ 'vite.config.js' ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   root: 'C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues',
  vite:config   publicDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\public',
  vite:config   cacheDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\node_modules\\.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   server: { fs: { strict: true, allow: [Array], deny: [Array] } },
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined
  vite:config   },
  vite:config   env: {
  vite:config     VITE_APP_BUILD_ENV: 'PROD',
  vite:config     VITE_USER_NODE_ENV: 'production',
  vite:config     VITE_APP_LOCATION_MOCK_ENABLE: 'false',
  vite:config     VITE_APP_PUBLIC_PATH: 'appointment-order',
  vite:config     VITE_BASE_URL: 'appointment-order',
  vite:config     VITE_PROJECT_TITLE: '预约工单',
  vite:config     BASE_URL: '/appointment-order/',
  vite:config     MODE: 'production',
  vite:config     DEV: false,
  vite:config     PROD: true
  vite:config   },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) { set: [Function (anonymous)] },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   }
  vite:config } +232ms
vite v2.7.6 building for production...
transforming (101) node_modules\.pnpm\vant@3.4.4_vue@3.2.26\node_modules\vant\es\tab\index.js  vite:resolve 1.03ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/badge/var.less +0ms
  vite:resolve 3.50ms ../style/var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/var.less +6ms
  vite:resolve 1.54ms @vant/icons/src/encode-woff2.less -> null +48ms
  vite:resolve 5.63ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/var.less +230ms
  vite:resolve 5.89ms ./css-variables.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/css-variables.less +0ms
  vite:resolve 6.09ms ./normalize.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/normalize.less +1ms
  vite:resolve 6.28ms ./animation.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/animation.less +0ms
  vite:resolve 6.64ms ./mixins/clearfix.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/mixins/clearfix.less +0ms
  vite:resolve 6.69ms ./mixins/ellipsis.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/mixins/ellipsis.less +1ms
  vite:resolve 6.73ms ./mixins/hairline.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/mixins/hairline.less +0ms
  vite:resolve 9.60ms ./var -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/var.less +17ms
  vite:resolve 3.55ms ../var -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/var.less +0ms
  vite:resolve 2.49ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/cell/var.less +102ms
  vite:resolve 2.89ms ../style/mixins/hairline -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/style/mixins/hairline.less +1ms
transforming (119) node_modules\.pnpm\vant@3.4.4_vue@3.2.26\node_modules\vant\es\cell\index.less  vite:resolve 1.73ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/field/var.less +68ms
  vite:resolve 2.06ms ../cell/var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/cell/var.less +0ms
  vite:resolve 1.27ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/search/var.less +53ms
transforming (125) node_modules\.pnpm\vant@3.4.4_vue@3.2.26\node_modules\vant\es\action-sheet\ActionSheet.js  vite:resolve 0.88ms ./common.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/@vant+icons@1.7.3/node_modules/@vant/icons/src/common.less +337ms
transforming (268) node_modules\.pnpm\vant@3.4.4_vue@3.2.26\node_modules\vant\es\tabs\TabsContent.js  vite:resolve 0.87ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/overlay/var.less +1s
  vite:resolve 1.02ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/loading/var.less +22ms
  vite:resolve 0.83ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/toast/var.less +29ms
  vite:resolve 0.95ms ./var.less -> C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/vant@3.4.4_vue@3.2.26/node_modules/vant/es/popup/var.less +33ms
✓ 292 modules transformed.
rendering chunks (5)...[@vitejs/plugin-legacy] legacy polyfills: Set(80) {
  'core-js/modules/es.promise',
  'core-js/modules/es.array.iterator',
  'regenerator-runtime/runtime',
  'core-js/modules/es.regexp.exec.js',
  'core-js/modules/es.string.split.js',
  'core-js/modules/es.object.to-string.js',
  'core-js/modules/web.dom-collections.for-each.js',
  'core-js/modules/es.string.trim.js',
  'core-js/modules/es.string.starts-with.js',
  'core-js/modules/es.object.assign.js',
  'core-js/modules/es.array.index-of.js',
  'core-js/modules/es.array.splice.js',
  'core-js/modules/es.array.slice.js',
  'core-js/modules/es.string.replace.js',
  'core-js/modules/esnext.global-this.js',
  'core-js/modules/es.array.iterator.js',
  'core-js/modules/es.set.js',
  'core-js/modules/es.string.iterator.js',
  'core-js/modules/web.dom-collections.iterator.js',
  'core-js/modules/es.weak-map.js',
  'core-js/modules/es.symbol.js',
  'core-js/modules/es.symbol.description.js',
  'core-js/modules/es.array.includes.js',
  'core-js/modules/es.map.js',
  'core-js/modules/es.array.filter.js',
  'core-js/modules/es.array.map.js',
  'core-js/modules/es.object.get-own-property-names.js',
  'core-js/modules/es.reflect.get.js',
  'core-js/modules/es.number.constructor.js',
  'core-js/modules/es.reflect.set.js',
  'core-js/modules/es.reflect.delete-property.js',
  'core-js/modules/es.reflect.has.js',
  'core-js/modules/es.reflect.own-keys.js',
  'core-js/modules/es.reflect.get-prototype-of.js',
  'core-js/modules/es.symbol.iterator.js',
  'core-js/modules/es.object.is-extensible.js',
  'core-js/modules/es.promise.js',
  'core-js/modules/es.object.keys.js',
  'core-js/modules/es.array.concat.js',
  'core-js/modules/es.regexp.constructor.js',
  'core-js/modules/es.regexp.to-string.js',
  'core-js/modules/es.string.includes.js',
  'core-js/modules/es.string.match.js',
  'core-js/modules/es.array.find-index.js',
  'core-js/modules/es.array.sort.js',
  'core-js/modules/es.array.reduce.js',
  'core-js/modules/es.array.fill.js',
  'core-js/modules/es.typed-array.uint8-array.js',
  'core-js/modules/es.typed-array.copy-within.js',
  'core-js/modules/es.typed-array.every.js',
  'core-js/modules/es.typed-array.fill.js',
  'core-js/modules/es.typed-array.filter.js',
  'core-js/modules/es.typed-array.find.js',
  'core-js/modules/es.typed-array.find-index.js',
  'core-js/modules/es.typed-array.for-each.js',
  'core-js/modules/es.typed-array.includes.js',
  'core-js/modules/es.typed-array.index-of.js',
  'core-js/modules/es.typed-array.iterator.js',
  'core-js/modules/es.typed-array.join.js',
  'core-js/modules/es.typed-array.last-index-of.js',
  'core-js/modules/es.typed-array.map.js',
  'core-js/modules/es.typed-array.reduce.js',
  'core-js/modules/es.typed-array.reduce-right.js',
  'core-js/modules/es.typed-array.reverse.js',
  'core-js/modules/es.typed-array.slice.js',
  'core-js/modules/es.typed-array.some.js',
  'core-js/modules/es.typed-array.sort.js',
  'core-js/modules/es.typed-array.to-locale-string.js',
  'core-js/modules/es.typed-array.to-string.js',
  'core-js/modules/web.url.to-json.js',
  'core-js/modules/es.symbol.to-string-tag.js',
  'core-js/modules/es.json.to-string-tag.js',
  'core-js/modules/es.math.to-string-tag.js',
  'core-js/modules/es.string.search.js',
  'core-js/modules/es.string.ends-with.js',
  'core-js/modules/es.array.find.js',
  'core-js/modules/es.array.from.js',
  'regenerator-runtime/runtime.js',
  'core-js/modules/es.object.get-own-property-descriptor.js',
  'core-js/modules/es.object.get-own-property-descriptors.js'
}
[dotenv][DEBUG] did not match key and value when parsing line 2: # mock定位设置
[dotenv][DEBUG] did not match key and value when parsing line 4: # 项目打包PUBLIC_PATH
[dotenv][DEBUG] did not match key and value when parsing line 6:
[dotenv][DEBUG] did not match key and value when parsing line 2: # mock定位设置
[dotenv][DEBUG] did not match key and value when parsing line 4: # 项目名称
[dotenv][DEBUG] did not match key and value when parsing line 6:
  vite:config using resolved config: {
  vite:config   root: 'C:/Users/HengtaiWang/WorkScopes/test-code/vite-lost-file-issues/node_modules/.pnpm/@vitejs+plugin-legacy@1.6.4_vite@2.7.6/node_modules/@vitejs/plugin-legacy',
  vite:config   configFile: undefined,
  vite:config   logLevel: 'error',
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-script-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:legacy-polyfills',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   build: {
  vite:config     target: false,
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\node_modules\\.pnpm\\@vitejs+plugin-legacy@1.6.4_vite@2.7.6\\node_modules\\@vitejs\\plugin-legacy\\dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     cssTarget: false,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: { input: [Object], output: [Object] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     write: false,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   configFileDependencies: [],
  vite:config   inlineConfig: {
  vite:config     root: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\node_modules\\.pnpm\\@vitejs+plugin-legacy@1.6.4_vite@2.7.6\\node_modules\\@vitejs\\plugin-legacy',
  vite:config     configFile: false,
  vite:config     logLevel: 'error',
  vite:config     plugins: [ [Object] ],
  vite:config     build: {
  vite:config       write: false,
  vite:config       target: false,
  vite:config       minify: 'terser',
  vite:config       assetsDir: 'assets',
  vite:config       rollupOptions: [Object]
  vite:config     }
  vite:config   },
  vite:config   base: '/',
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   publicDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\node_modules\\.pnpm\\@vitejs+plugin-legacy@1.6.4_vite@2.7.6\\node_modules\\@vitejs\\plugin-legacy\\public',
  vite:config   cacheDir: 'C:\\Users\\HengtaiWang\\WorkScopes\\test-code\\vite-lost-file-issues\\node_modules\\.pnpm\\@vitejs+plugin-legacy@1.6.4_vite@2.7.6\\node_modules\\@vitejs\\plugin-legacy\\node_modules\\.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   server: { fs: { strict: true, allow: [Array], deny: [Array] } },
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined
  vite:config   },
  vite:config   env: {
  vite:config     VITE_APP_BUILD_ENV: 'PROD',
  vite:config     VITE_USER_NODE_ENV: 'production',
  vite:config     VITE_APP_LOCATION_MOCK_ENABLE: 'false',
  vite:config     VITE_APP_PUBLIC_PATH: 'appointment-order',
  vite:config     VITE_BASE_URL: 'appointment-order',
  vite:config     VITE_PROJECT_TITLE: '预约工单',
  vite:config     BASE_URL: '/',
  vite:config     MODE: 'production',
  vite:config     DEV: false,
  vite:config     PROD: true
  vite:config   },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) { set: [Function (anonymous)] },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: {
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   }
  vite:config } +10s
dist/assets/index-legacy.c9064487.js            6.50 KiB / gzip: 2.75 KiB
dist/assets/create-legacy.f9499fed.js           0.30 KiB / gzip: 0.21 KiB
dist/assets/my-reservation-legacy.8b8ccfbf.js   0.40 KiB / gzip: 0.28 KiB
dist/assets/polyfills-legacy.806568ef.js        86.41 KiB / gzip: 34.50 KiB
dist/assets/vendor-legacy.eb654667.js           195.86 KiB / gzip: 79.15 KiB
dist/index.html                          1.91 KiB
dist/assets/index.4894fae1.js            3.64 KiB / gzip: 1.70 KiB
dist/assets/create.8ac31c56.js           0.17 KiB / gzip: 0.15 KiB
dist/assets/my-reservation.a8f166fa.js   0.29 KiB / gzip: 0.23 KiB
dist/assets/index.77e5712b.css           1.65 KiB / gzip: 0.68 KiB
dist/assets/index.b38b35b6.css           10.57 KiB / gzip: 1.90 KiB
dist/assets/vendor.584aabef.css          60.14 KiB / gzip: 29.80 KiB
dist/assets/vendor.2b52bdd8.js           119.79 KiB / gzip: 45.63 KiB

进程已结束,退出代码0

Validations

sapphi-red commented 2 years ago

It seems your reproduction does not reproduce the issue.

I ran npm run build:STG. (and also with npm run build:PROD)

The content of my-reservation-legacy.550e8e32.js was as below.

System.register(["./index-legacy.1d7bab64.js","./index-legacy.4b5acee9.js"],(function(e){"use strict";var n,t,r,c,a,i;return{setters:[function(e){n=e._,t=e.N,r=e.o,c=e.c,a=e.a},function(e){i=e.S}],execute:function(){e("default",n({name:"MyReservation",components:{Search:i}},[["render",function(e,n,i,u,s,o){var d=t("Search");return r(),c("div",null,[a(d)])}]]))}}}));
github-actions[bot] commented 2 years ago

Hello @wht300. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.