Help me to add 'cssHash' to 'compilerOptions' in sveltkit idk where ? #10385
Unanswered
good-dev-student
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I appreciate your help. 😻😽 |
Beta Was this translation helpful? Give feedback.
0 replies
-
And if i want to change the cssHash on dev also dosen't work idk why and why work only on prod? import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
const compilerOptions = {};
// if (process.env.NODE_ENV === 'production') {
compilerOptions.cssHash = ({ hash, css }) => `ai-${hash(css)}`;
// }
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [vitePreprocess({})],
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
},
compilerOptions
};
export default config; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
please help me
The goal is to chnage classes like this :
to this :
I add the code to
svelte.config.js
:Final code like this:
i will see WARNING like thsis:
[vite-plugin-svelte] The following Svelte compilerOptions are controlled by vite-plugin-svelte and essential to its functionality. User-specified values are ignored. Please remove them from your configuration: cssHash
in
vite.config.ts
not workingNOT like this:
or this:
Beta Was this translation helpful? Give feedback.
All reactions