Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle webcomponent.js with webcomponent.css #450

Open
frankred opened this issue Jun 14, 2023 · 0 comments
Open

Bundle webcomponent.js with webcomponent.css #450

frankred opened this issue Jun 14, 2023 · 0 comments

Comments

@frankred
Copy link

frankred commented Jun 14, 2023

I have a pure vanilla webcomponent, lets call it "Spinner.js" and a "Spinner.css". Can I bundle this to just one JS-File including
the CSS file?.

Currently my rollup configuration looks like this, but CSS ins not bundle inside *.JS File

const bundle = await rollup({
		input: `${webcomponent.pathToWebcomponent}`,
		plugins: [nodeResolve(), commonjs(),postcss({
			extract: false,
			minimize: true,
			inject: {
				insertAt: 'top',
			},
		}), terser()],
	})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant