doublesecretagency / craft-cpcss

Control Panel CSS plugin for Craft CMS
MIT License
117 stars 8 forks source link

Feature Request: Allow twig code in cssFile settings #19

Closed webrgp closed 1 year ago

webrgp commented 2 years ago

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.

khalwat commented 1 year ago

@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 1 year ago

Thanks Andrew!