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

[Bug]: The dynamic import dependency module has been elevated to the entrance #572

Closed
lzxb opened this issue Dec 18, 2024 · 0 comments
Closed
Labels
🐞 bug Something isn't working

Comments

@lzxb
Copy link

lzxb commented Dec 18, 2024

Version

System:
    OS: macOS 15.1.1
    CPU: (8) arm64 Apple M1
    Memory: 100.02 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Safari: 18.1.1
  npmPackages:
    @rslib/core: ^0.1.4 => 0.1.4

Details

rslib.config.ts

import { defineConfig } from '@rslib/core';

export default defineConfig({
  lib: [
    {
      bundle: true,
      format: 'esm',
      syntax: 'esnext',
      dts: false,
      autoExternal: true,
      
    },
  ],
  output: {
    externals: {
      vue: 'vue',
      axios: 'axios'
    },
  }
});

src/index.ts

export function start () {
    import('./app');
}

export async function http () {
    console.log(await import('axios'))
}

src/app.ts

import { version } from 'vue'

console.log(version);
Image

Associate to web-infra-dev/rspack#8736

Reproduce link

https://github.com/lzxb/rspack-dynamic-import-to-top

Reproduce Steps

git checkout feat-rslib
pnpm i
pnpm build

@lzxb lzxb added the 🐞 bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants