Skip to content

ability to remove or modify css class name "svelte-" prefix #2900

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

Closed
eduarddotgg opened this issue May 29, 2019 · 7 comments
Closed

ability to remove or modify css class name "svelte-" prefix #2900

eduarddotgg opened this issue May 29, 2019 · 7 comments

Comments

@eduarddotgg
Copy link

Is there any way to remove or modify css class name "svelte-" prefix?

@Conduitry
Copy link
Member

There is not. #570 has been left open until this is supported. See also this comment.

@eduarddotgg
Copy link
Author

don't quite understand how to use example showed in #570 with Webpack.

@Conduitry
Copy link
Member

You'd pass it the same way you pass any options to svelte-loader - as an options object next to loader: 'svelte-loader'. But the feature does not exist yet, and there's already an issue for it.

@Conduitry
Copy link
Member

This ticket is also more or less a direct duplicate of #2822, which was closed because this is what #570 is being left open for.

@cloudyjeep
Copy link

svelte ver: 3.29.0
@iamfrntdv for alternative, changes code in ../node_modules/svelte/compiler.js at line 24268
compile.js

@khalid-tian
Copy link

Use svelte csshash compiler options, just if someone still need it.

@seanvelasco
Copy link

adding to the above comment, modify svelte.config.js accordingly

const config = {
	preprocess: vitePreprocess(),
	kit: {
		adapter: adapter()
	},
	compilerOptions: {
		cssHash: ({ hash, css }) => `your-custom-prefix-${hash(css)}`
	}
}

took me a few minutes to figure it out, thought it might be helpful to others

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

5 participants