-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Remove inline scripts from the build #27004
Description
Describe the feature
Hi Development Team,
I hope everything is going well. I would like to propose a new feature for Nuxt.js that could be very useful for many developers: the ability to remove inline scripts from the build.
Currently, when building a Nuxt.js project, JavaScript scripts can be embedded directly into the HTML pages. However, this practice can increase the page size and negatively impact performance, especially on devices with slow or limited internet connections.
My proposal is to implement an option in the Nuxt.js configuration that allows developers to specify whether they want to include inline scripts or prefer to exclude them from the final build. This would allow developers to optimize their applications for performance by reducing the overall page size and improving the user experience.
This feature could be implemented through a setting in the Nuxt.js configuration file, for example:
// nuxt.config.js
export default {
// Other configurations...
build: {
inlineScripts: false // Default setting to true to maintain current behavior
}
}
With this setting, developers could easily control whether they want to include inline scripts in the build or not.
I understand that this change may require some significant adjustments within the core of Nuxt.js, but I believe the performance and page load optimization benefits would definitely make it worthwhile.
Would it be possible to consider including this feature in future versions of Nuxt.js? It would be great to have this option available to further enhance web development with Nuxt.js.
Thank you for your attention and for all the work you do to continually improve Nuxt.js.
Best regards.
Additional information
- Would you be willing to help implement this feature?
- Could this feature be implemented as a module?
Final checks
- Read the contribution guide.
- Check existing discussions and issues.