- Issue created by @darvanen
- 🇦🇺Australia darvanen Sydney, Australia
I thought about creating a patch for an "assets-only" flag on entrypoints in the library definition, but I wasn't sure it would be accepted as a direction for the module.
- 🇵🇱Poland wotnak
As far as I'm aware, the current Vite version works fine with scss entrypoints.
Example:# theme.libraries.yml global-styling: vite: true css: theme: scss/style.scss: {}
// vite.config.js import { defineConfig } from "vite"; import multiInput from "rollup-plugin-multi-input"; export default defineConfig(({ mode }) => { return { plugins: [multiInput()], build: { manifest: true, rollupOptions: { input: ["scss/**/*.scss", "!scss/**/_*.scss"], }, }, }; });
It builds fine and produces vite manifest that is correctly handled by drupal/vite module:
// dist/.vite/manifest.json { ... "scss/style.scss": { "file": "assets/scss/style-DYjrZ8Ot.css", "src": "scss/style.scss", "isEntry": true }, ... }
- Status changed to Closed: works as designed
5 months ago 11:52pm 5 August 2024 - 🇦🇺Australia darvanen Sydney, Australia
Right you are!
I had trouble with scss entrypoints in the past but I think that might have been due to using both `lib` and `rollupOptions` in the same config which I've discovered clash.
Thanks for pointing me back in the right direction!