\n \u003Clink rel=\"preload\" href=\"/_nuxt/static/1613840478/payload.js\" as=\"script\" />\n \u003Clink rel=\"preload\" href=\"/_nuxt/static/1613840478/manifest.js\" as=\"script\" />\n \u003C/head>\n \u003Cbody>\n \u003C!-- ... -->\n \u003Cscript defer src=\"/_nuxt/static/1613840478/state.js\">\u003C/script>\n \u003C/body>\n\u003C/html>\n```\n\nThese scripts should not be injected.\n\nSee also #8178 (staled out).",[3019,3022],{"name":3020,"color":3021},"pending triage","E99695",{"name":3023,"color":3024},"2.x","d4c5f9",8866,"nuxt","closed","full static doesn't respect injectScripts: false ","2023-01-22T15:38:48Z","https://github.com/nuxt/nuxt/issues/8866",0.59375304,{"description":3033,"labels":3034,"number":3037,"owner":3026,"repository":3026,"state":3027,"title":3038,"updated_at":3039,"url":3040,"score":3041},"### Version\n\n[v2.4.5](https://github.com/nuxt.js/releases/tag/v2.4.5)\n\n### Reproduction link\n\n[https://github.com/dinerojs/dinerojs.com](https://github.com/dinerojs/dinerojs.com)\n\n### Steps to reproduce\n\n1. Generate a pre-rendered build with `nuxt generate` or `yarn generate`.\n2. Inspect the `_nuxt` directory and see the generated JavaScript files.\n\n### What is expected ?\n\nWhen pre-rendering my website with `nuxt generate`, I would expect my HTML to be pre-rendered and for all the JavaScript that's used for this purpose not to be in the final build.\n\nIn fewer words, I would expect the only JavaScript that ends up in the final build to be the one that's necessary for runtime, nothing else.\n\n### What is actually happening?\n\nPre-rendering the website fills the `_nuxt` directory with unnecessary and heavy JavaScript. The HTML files are appropriately rendered, but the built JavaScript contains unnecessary things like the Markdown parser, Highlight.js, Nuxt store, etc.\n\nAnother side effect of getting all that development JavaScript in the production build is that it tries to apply build-time logic at runtime (e.g., determining what sidebar item is active to open the right parent, doesn't work because trying to determine this from `this.$route`).\n\n### Additional comments?\n\nI'm not sure how to tell Nuxt how to differentiate what I'll need in my final bundle (e.g., code to handle collapsing menus) and what is only there for generation of HTML. I couldn't find it in the documentation.\n\nThere are some closed tickets on these topics (e.g., https://github.com/nuxt/nuxt.js/issues/2822) but they only offer hacky and incomplete workarounds. Using Cheerio to strip out unwanted generated code doesn't address the real issue (code that shouldn't be there in the first place), adds CI time, and doesn't account for the JavaScript that you do need to keep.\n\nThanks a lot in advance for your help! Been enjoying using Nuxt and this is likely the final hurdle before I can push my project live. 🙂\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This bug report is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c8848\">#c8848\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3035,3036],{"name":3020,"color":3021},{"name":3023,"color":3024},5260,"Lots of unnecessary JavaScript in generated Nuxt static build","2023-01-22T15:33:01Z","https://github.com/nuxt/nuxt/issues/5260",0.6396217,{"description":3043,"labels":3044,"number":3046,"owner":3026,"repository":3026,"state":3027,"title":3047,"updated_at":3048,"url":3049,"score":3050},"Hi, guys! Can you anyone help me?\r\n\r\nDoes nuxt have any option to exclude `_nuxt` scripts in generate mode?\r\n\r\nI need to generate only static html version of Vue app.\r\nWithout `_nuxt` folder and included links and script.\r\nI don`t need to use javascript on client and those scripts in `_nuxt` former makes my project to heavy.\r\n\r\nBasically, I want to use NUXT just for static html generation, NOT Pre-rendering with spa on client.\r\n \r\n`\u003Clink href=\"/_nuxt/manifest.10d0ff23a2bf4f09b86d.js\" rel=\"preload\" as=\"script\">\u003Clink href=\"/_nuxt/vendor.2c4933a76531d246be17.js\" rel=\"preload\" as=\"script\">\u003Clink href=\"/_nuxt/app.b868b05b142119955871.js\" rel=\"preload\" as=\"script\">\u003Clink href=\"/_nuxt/layouts/default.860485f7694926d31a51.js\" rel=\"preload\" as=\"script\">\u003Clink href=\"/_nuxt/pages/index.f4640f8dc2b172dfb993.js\" rel=\"preload\" as=\"script\">\u003Clink>`\r\n\r\n`\u003Cscript type=\"text/javascript\">window.__NUXT__={layout:\"default\",data:[{}],error:null,serverRendered:!0}\u003C/script>\u003Cscript defer=\"\" src=\"/_nuxt/manifest.10d0ff23a2bf4f09b86d.js\">\u003C/script>\u003Cscript defer=\"\" src=\"/_nuxt/layouts/default.860485f7694926d31a51.js\">\u003C/script>\u003Cscript defer=\"\" src=\"/_nuxt/pages/index.f4640f8dc2b172dfb993.js\">\u003C/script>\u003Cscript defer=\"\" src=\"/_nuxt/vendor.2c4933a76531d246be17.js\">\u003C/script>\u003Cscript defer=\"\" src=\"/_nuxt/app.b868b05b142119955871.js\">\u003C/script>`\r\n\r\nThanks!\r\n\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2450\">#c2450\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3045],{"name":3023,"color":3024},2822,"Using NUXT.js just for static html generation with script (vendor.js, manifest.js, app,js, pages/index.js, layouts/default.js)","2023-01-18T16:02:39Z","https://github.com/nuxt/nuxt/issues/2822",0.64055336,{"description":3052,"labels":3053,"number":3055,"owner":3026,"repository":3026,"state":3027,"title":3056,"updated_at":3057,"url":3058,"score":3059},"I can not create the issue using https://nuxtjs.cmty.io/issues/new \u003C-- the page doesn't work.\r\n\r\nIs it possible to inject the webpack bundled javascript file names into nuxt context?\r\nI can see I have access to it in this hook:\r\n\r\nnuxt.hook('render:resourcesLoaded', (resources) => {\r\n if (resources && resources.clientManifest && resources.clientManifest.async) {\r\n asyncJavacriptChunksMap = resources.clientManifest.async;\r\n console.log(asyncJavacriptChunksMap);\r\n\r\nprints ->\r\n'Images.js',\r\n 'CheckoutSender.js',\r\n 'CheckoutOrderOverview.js',\r\n 'CheckoutReceipt.js',\r\n 'CheckoutPaymentDetails.js',\r\n 'CheckoutDeliveryDetails.js',\r\n 'ProductDetailsOverview.js',\r\n\r\nIn production the hash values are included.\r\nIn our solution we use asynch components like this: \r\n components: {\r\n ProductSlider: () => import(/* webpackChunkName: \"ProductSlider\" */'~compositions/ProductSlider'),\r\n OccasionSlider: () => import(/* webpackChunkName: \"OccasionSlider\" */'~compositions/OccasionSlider'),\r\n HeroBanner: () => import(/* webpackChunkName: \"HeroBanner\" */'~components/Hero'),\r\n Textbox: () => import(/* webpackChunkName: \"Textbox\" */'~components/Textbox'),\r\n Splitview: () => import(/* webpackChunkName: \"Splitview\" */'~compositions/Splitview'),\r\n\r\nI can see nuxt out of the box only adds the scripts as prefetch. The modules are rendered in a dynamic component based on cms data.\r\n \r\n\u003Ctemplate v-if=\"modules\">\r\n \u003Ccomponent v-for=\"(item, index) in modules\" v-if=\"hasContentAndType(item)\" :is=\"item.type\" :content=\"item\" :key=\"index\">\u003C/component>\r\n \u003C/template>\r\n\r\nI would like to add preload link tags as well as http2 Link tag assets based on the modules that are turned on for a page in our cms. Do you know any way this is possible? Or can I request this feature?\r\n\r\nIf i can somehow add the resources map to nuxt context I think I can solve it from there. \r\n\r\n\r\n\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c6937\">#c6937\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3054],{"name":3023,"color":3024},3249,"Add preload tags dynamically. ","2023-01-18T16:23:54Z","https://github.com/nuxt/nuxt/issues/3249",0.6455283,{"description":3061,"labels":3062,"number":3065,"owner":3026,"repository":3026,"state":3027,"title":3066,"updated_at":3067,"url":3068,"score":3069},"### Version\n\n[v2.6.3](https://github.com/nuxt.js/releases/tag/v2.6.3)\n\n### Reproduction link\n\n[https://github.com/maunier/nuxt-learning](https://github.com/maunier/nuxt-learning)\n\n### Steps to reproduce\n\n1. npm run dev \n2. visit http://localhost:3000/\n\n\n### What is expected ?\n\nhtml shouldn't load any script because I have configed \"inject: false\" for bundleRenderer in nuxt.config.js\n\n### What is actually happening?\n\nit loads \"commons.app.js\" \"vendors.app.js\" and so on.\n\n### Additional comments?\n\ni need a template that automaticly inject all the script at IE10+ otherwise don't inject any script \n\n\u003C!--cmty-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This bug report is available on \u003Ca href=\"https://cmty.app/nuxt\">Nuxt\u003C/a> community (\u003Ca href=\"https://cmty.app/nuxt/nuxt.js/issues/c9162\">#c9162\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3063,3064],{"name":3020,"color":3021},{"name":3023,"color":3024},5664,"inject: false in bundleRenderer config not work","2023-01-22T15:33:07Z","https://github.com/nuxt/nuxt/issues/5664",0.6524114,{"description":3071,"labels":3072,"number":3077,"owner":3026,"repository":3026,"state":3027,"title":3078,"updated_at":3079,"url":3080,"score":3081},"### Environment\r\n\r\nproduction \r\n\r\n### Reproduction\r\n\r\n- Setup new nuxtjs 3 project \r\n- Create an index.vue page\r\n- Add static content (only HTML and CSS)\r\n- run `npm run generate`\r\n\r\n\r\n### Describe the bug\r\n\r\nI want to generate a static site which has 0 dependency on javascript. The project is only built using HTML and SCSS.\r\n\r\nHowever, after opening the static generated file, it loads various javascript files in the browser’s network tab.\r\n\r\nHow do you get rid of javascript files after the build?\r\n```html\r\n\u003Clink rel=\"modulepreload\" as=\"script\" crossorigin href=\"/_nuxt/entry.uEwHeBjl.js\">\r\n\u003Clink rel=\"modulepreload\" as=\"script\" crossorigin href=\"/_nuxt/default.D3HJ612v.js\">\r\n\u003Clink rel=\"modulepreload\" as=\"script\" crossorigin href=\"/_nuxt/fetch.X0yPUN-o.js\">\r\n\u003Clink rel=\"modulepreload\" as=\"script\" crossorigin href=\"/_nuxt/index.m3rl-4ZK.js\">\r\n\u003Clink rel=\"modulepreload\" as=\"script\" crossorigin href=\"/_nuxt/vue.f36acd1f.fZrwODD9.js\">\r\n\u003Clink rel=\"prefetch\" as=\"script\" crossorigin href=\"/_nuxt/error-404.3IAJHKGW.js\">\r\n\u003Clink rel=\"prefetch\" as=\"script\" crossorigin href=\"/_nuxt/error-500.M14LAvY2.js\">\r\n\u003Cscript type=\"module\" src=\"/_nuxt/entry.uEwHeBjl.js\" crossorigin>\u003C/script>\r\n```\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[3073,3076],{"name":3074,"color":3075},"3.x","29bc7f",{"name":3020,"color":3021},24919,"Multiple javascript files are loading on static build in Nuxtjs 3","2023-12-28T10:57:20Z","https://github.com/nuxt/nuxt/issues/24919",0.6549981,{"labels":3083,"number":3085,"owner":3026,"repository":3026,"state":3027,"title":3086,"updated_at":3087,"url":3088,"score":3089},[3084],{"name":3023,"color":3024},4360,"duplicate script link in head and body, because of preloading them","2023-01-18T20:06:10Z","https://github.com/nuxt/nuxt/issues/4360",0.6604537,{"description":3091,"labels":3092,"number":3100,"owner":3026,"repository":3026,"state":3027,"title":3101,"updated_at":3102,"url":3103,"score":3104},"Hi,\r\n\r\nI'm testing nuxt for an Amp site. Everything is working perfectly (thanks ❤️ ) except one tiny thing.\r\nIn the examples you gave\r\n``` javascript\r\n// Remove every script tag from generated HTML\r\nhtml = html.replace(/\u003Cscript\\b[^\u003C]*(?:(?!\u003C\\/script>)\u003C[^\u003C]*)*\u003C\\/script>/gi, '')\r\n```\r\nAll scripts tags are removed without consideration, but the solution it not good because amp does allow `\u003Cscript type=\"application/json\">\u003C/script>` (in amp-analytics for example)\r\nIt's not really a bug but it can be confusing for newcomers if they simply copy the code :)\r\n\r\nBecause I'm not a regex master, I didn't succeed in modifying the regex to only match script tags that does not have that type (screw you negative lookahead). So I'v done this (which is absolutely not bulletproof but a quick fix)\r\n```javascript\r\nhtml = html.replace(/\u003Cscript\\b[^\u003C]*(?:(?!\u003C\\/script>)\u003C[^\u003C]*)*\u003C\\/script>/gi, (str) => {\r\n if (/application\\/json/.test(str)) {\r\n return str;\r\n }\r\n return '';\r\n });\r\n```\r\n\r\nIf someone have a better fix 👍 \r\n\r\nthanks\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This feature request is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2569\">#c2569\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[3093,3096,3099],{"name":3094,"color":3095},"enhancement","8DEF37",{"name":3097,"color":3098},"stale","ffffff",{"name":3023,"color":3024},2962,"Nuxt amp example: should not remove all script tags","2023-01-18T16:09:49Z","https://github.com/nuxt/nuxt/issues/2962",0.6609738,{"labels":3106,"number":3110,"owner":3026,"repository":3026,"state":3027,"title":3111,"updated_at":3112,"url":3113,"score":3114},[3107,3108,3109],{"name":3097,"color":3098},{"name":3020,"color":3021},{"name":3023,"color":3024},7821,"client.manifest.json dosen't contain all modules","2023-01-22T15:36:04Z","https://github.com/nuxt/nuxt/issues/7821",0.66677755,{"description":3116,"labels":3117,"number":3123,"owner":3026,"repository":3026,"state":3027,"title":3124,"updated_at":3125,"url":3126,"score":3127},"For some use cases, users may wish to have a purely HTML + CSS website where interactivity is not required. Shipping JS to hydrate such a site is unneeded.\r\n\r\nFor these use cases, we could consider support a top level option (or a per-path route rule) to disable rendering JS preload hints + script tags within the renderer.\r\n\r\nSome initial steps:\r\n\r\n- [x] create module: [nuxt-zero-js](https://github.com/danielroe/nuxt-zero-js)\r\n\r\n**Note**: We may also need to update https://github.com/nuxtlabs/vue-telescope-api to accurately detect Nuxt on such sites. At the moment, it is unaware that https://nuxt.new/ is built with Nuxt 😆",[3118,3119,3122],{"name":3094,"color":3095},{"name":3120,"color":3121},"discussion","538de2",{"name":3074,"color":3075},14765,"allow disabling client-side JS entirely","2024-07-22T21:23:50Z","https://github.com/nuxt/nuxt/issues/14765",0.67021245,["Reactive",3129],{},["Set"],["ShallowReactive",3132],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fNvqP1XUn_9zZtw2GpYi6bb9GMHfPqNy5f7AD8l-tY_A":-1},"/nuxt/nuxt/8178"]