2

Can you anyone help me?

Does nuxt have any option to exclude _nuxt scripts in generate mode?

I need to generate only static html version of Vue app. Without _nuxt folder and included links and script. I dont need to use javascript on client and those scripts in _nuxt former makes my project to heavy.

Basically, I want to use NUXT just for static html generation, NOT Pre-rendering with spa on client.

<link href="/_nuxt/manifest.10d0ff23a2bf4f09b86d.js" rel="preload" as="script">
<link href="/_nuxt/vendor.2c4933a76531d246be17.js" rel="preload" as="script">
<link href="/_nuxt/app.b868b05b142119955871.js" rel="preload" as="script">
<link href="/_nuxt/layouts/default.860485f7694926d31a51.js" rel="preload" as="script">
<link href="/_nuxt/pages/index.f4640f8dc2b172dfb993.js" rel="preload" as="script"><link>

<script type="text/javascript">window.__NUXT__={layout:"default",data:[{}],error:null,serverRendered:!0}</script>
<script defer="" src="/_nuxt/manifest.10d0ff23a2bf4f09b86d.js"></script>
<script defer="" src="/_nuxt/layouts/default.860485f7694926d31a51.js"></script>
<script defer="" src="/_nuxt/pages/index.f4640f8dc2b172dfb993.js"></script>
<script defer="" src="/_nuxt/vendor.2c4933a76531d246be17.js"></script>
<script defer="" src="/_nuxt/app.b868b05b142119955871.js"></script>

Thanks!

1 Answer 1

4

Not yet (and probably never...), because Nuxt.js is fully based on Vue.js SSR, so it needs JS files to work. The generate mode it's more a bonus to create website without SSR. But all the engine is based on SSR inse.

For your needs, look for another framework dedicated to create static website: hexo, gatsby, phenomic, hugo, jekyll, ...

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks you. But I already have application written on Vue.js. So the solution what I see it is fork and do it by myself.
Maybe you can create a Nuxt module that will clean your files on post-build process (just an idea, to check if feasible ^^)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.