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

using build.rollupOptions.output.manualChunks #395

Open
5 tasks done
kolirt opened this issue Apr 3, 2024 · 0 comments
Open
5 tasks done

using build.rollupOptions.output.manualChunks #395

kolirt opened this issue Apr 3, 2024 · 0 comments

Comments

@kolirt
Copy link

kolirt commented Apr 3, 2024

Describe the bug

How can I use manualChunks?

vite.config.ts

export default defineConfig({
  build: {
    rollupOptions: {
      output: {
        manualChunks: {
          lottie: ['vue3-lottie']
        }
      }
    }
  },
})

logs

 ERROR                                                                                                                                                                                                                    11:23:55
[vite-ssg] An internal error occurred.


 ERROR  [vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues                                                                                                               11:23:55

/node_modules/rollup/dist/es/shared/parseAst.js:337
        base = Object.assign(new Error(base.message), base);
                             ^

Error [RollupError]: "vue3-lottie" cannot be included in manualChunks because it is resolved as an external module by the "external" option or plugins.
    at error (/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at ModuleLoader.loadEntryModule (/node_modules/rollup/dist/es/shared/node-entry.js:18049:20)
    at async Promise.all (index 0)
    at async Promise.all (index 0) {
  code: 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS'
}

Reproduction

System Info

System:
    OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 21.60 GB / 31.28 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.20.0 - ~/n/bin/node
    Yarn: 1.22.21 - ~/n/bin/yarn
    npm: 10.5.0 - ~/n/bin/npm
  Browsers:
    Chrome: 123.0.6312.86

Used Package Manager

yarn

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
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