Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here is something wrong with 【npm/yarn/pnpn】 run 【dev/build】 #50

Open
12914hh opened this issue May 30, 2024 · 0 comments
Open

Comments

@12914hh
Copy link

12914hh commented May 30, 2024

This is My packjson "vite-plugin-top-level-await": "^1.4.1",
And this is my vite.config.ts

import { fileURLToPath, URL } from 'node:url'

import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import topLevelAwait from 'vite-plugin-top-level-await'
import path from 'path'

export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, __dirname)
  return {
    define: {
      'process.env': env,
    },
    plugins: [
      vue({
        template: {
          compilerOptions: {
            isCustomElement: (tag) => ['swiper-slide', 'swiper-container'].includes(tag),
          },
        },
        reactivityTransform: true,
      }),
      vueJsx(),
      topLevelAwait({
        // The export name of top-level await promise for each chunk module
        promiseExportName: '__tla',
        // The function to generate import names of top-level await promise in each chunk module
        promiseImportName: (i) => `__tla_${i}`,
      }),
    ],
    base: '/zwr/portal/',
    // logLevel: 'error',
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('./src', import.meta.url)),
      },
    },
    server: {
      port: 3000,
      proxy: {
         .....
      },
    },
    css: {
      preprocessorOptions: {
        less: {
          modifyVars: {
            hack: `true; @import (reference) "${path.resolve('src/style/index.less')}";`,
          },
          javascriptEnabled: true,
        },
      },
    },
  }
})

image

But Yesterday ,everythings is ok,And the node_modules has this file。
image

What can I do for this?
Thank you and Best wish~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant