fix(nuxt): don't disable scripts in dev mode
🔗 Linked issue
resolves #7737
❓ Type of change
- [ ] 📖 Documentation (updates to the documentation or readme)
- [x] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
We should only respect experimental.noScripts in built mode.
📝 Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders
Deploy Preview for nuxt3-docs ready!
| Name | Link |
|---|---|
| Latest commit | 57c7382e9d3a54f9bad071a2af59f00361a3b51f |
| Latest deploy log | https://app.netlify.com/sites/nuxt3-docs/deploys/632c17e8f3a2610008869926 |
| Deploy Preview | https://deploy-preview-7745--nuxt3-docs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Doesn't it make sense to have consistent behavior between dev and prod for disabling scripts?
We are testing for dev here:
https://github.com/nuxt/framework/blob/5605f1ce18d152122d966ac37c35c4c434b16184/packages/nuxt/src/core/nuxt.ts#L95
I think HMR for dev, but no scripts for built site seems a better default, but happy to be convinced otherwise.