doublesecretagency/craft-cpcss

Feature Request: Allow twig code in cssFile settings

Closed this issue · 2 comments

I am using Vite to compile my css, and the output is name.xxxxx.css

By allowing Twig in the field, I could use Andrew's Vite plugin and enter {{ craft.vite.entry('name.css') }} which would grab the correct file path from the manifest.

@webrgp you could also generate your output file names without the hashes if you wanted to:

rollupOutputOptions: {
    entryFileNames: `[name].js`,
    chunkFileNames: `[name].js`,
    assetFileNames: `[name].[ext]`
}

ref: https://vitejs.dev/config/build-options.html#build-rollupoptions

webrgp commented

Thanks Andrew!