nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

Can we export nuxt project as web components ?

Open bnping opened this issue 4 years ago • 9 comments

Hi, In vue js, we can export the entire projet as web component and import it in other projets.

Can we export nuxt project as web component ?

bnping avatar Oct 20 '20 12:10 bnping

As npm module?

b01110011 avatar Oct 23 '20 17:10 b01110011

@b01110011 yes. Do you know please ?

bnping avatar Oct 23 '20 19:10 bnping

If I understand your question correctly: Registry your project in npm, then install it and run. Something like

cd node_modules/project_name
npm run build
npm run start

above commands, may write in package.json as script

b01110011 avatar Oct 23 '20 19:10 b01110011

@b01110011 inside project_name, i put my nuxt project ?

bnping avatar Oct 23 '20 19:10 bnping

project_name is your name of npm module

b01110011 avatar Oct 23 '20 19:10 b01110011

maybe my question not claire. I want to export my nuxt project as npm module or web components.

bnping avatar Oct 23 '20 20:10 bnping

this module must run on localhost? as any other application, but only as npm dependency?

b01110011 avatar Oct 23 '20 20:10 b01110011

as npm dependency.

bnping avatar Oct 23 '20 20:10 bnping

then the instruction above


If your module has serverMiddleware you need rewrite it as cjs module (commonJs) or you catch fatal errors

b01110011 avatar Oct 23 '20 21:10 b01110011