oruga
oruga copied to clipboard
[Nuxt Bridge] Tree shaking not working
Overview of the problem
Oruga version: 0.5.3 Vuejs version: Nuxt - 2.16.0-27358576.777a4b7f OS/Browser: MacOS 11
Description
Making use of tree shaking of Oruga does not work. Importing one component makes all modules in the build bundle.
Steps to reproduce
Minimal reproduction: https://github.com/Tragio/oruga-tree-shaking-bug
The client bundle will bundle right and show the webpack analyzer, however, the server bundle will fail due to nuxt/bridge#128 but it's not related to this issue and should not interfere with its resolution.
Thank you for the amazing work 😃
Workaround for now (we'll need to investigate in Nuxt what the root cause is here):
import { defineNuxtConfig } from '@nuxt/bridge'
export default defineNuxtConfig({
bridge: {
resolve: false,
}
})
Workaround for now (we'll need to investigate in Nuxt what the root cause is here):
import { defineNuxtConfig } from '@nuxt/bridge' export default defineNuxtConfig({ bridge: { resolve: false, } })
Thank you for your quick reply!! Doing that workaround works but when I try to access it I get a 500 error, at least on Vercel and using my project.
That's an unrelated issue. See https://v3.nuxtjs.org/concepts/esm.
Edit: Forgive my too hasty assumption; are you saying this occurs only when you set resolve: false
?
That's an unrelated issue. See https://v3.nuxtjs.org/concepts/esm.
Edit: Forgive my too hasty assumption; are you saying this occurs only when you set
resolve: false
?
Yes, that's correct. This issue only happens when I use that workaround 🙃
@Tragio we might fix it using the same approach of https://github.com/oruga-ui/oruga/pull/273
@Tragio we've just released 0.5.4, please check it
@jtommy thank you. I updated and also deleted .nuxt
, .output
, node_modules
, and yarn.lock
. Did a yarn install, and then a build. All is the same 🤔
Do you see the new file index.mjs into dist/esm ?
Do you see the new file index.mjs into dist/esm ?
Yes, I have it here.
What's the error right now?
What's the error right now?
Tree shaking keeps not working.
The fix should resolve the problem using the workaround. I think that @danielroe is investigating about tree shaking
@Tragio any news?