Vite use bad path for css file imported in stylus file

576 Views Asked by At

I'm using vite with stylus. The files are :

/src/
  stylesheet/
    project.styl
    one.styl
    two.css
  main.js

main.js

import './stylesheet/project.styl'

project.styl

@require 'one'
@require 'two.css'

vite.config.js

...
export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        }
    },
    server: {
        port: 8080,
        strictPort: true
    },
    css: {
        preprocessorOptions: {
            scss: {
                includePaths: ['node_modules/foundation-sites/scss'],
            },
        },
    },
})

Using vite dev server, two.css isn't loaded by because the vite browser client try to fetch the file : /two.css (at root path). Stylus compiler does not complain about a bad path.

What can I do t have vite either handle the css file path or let stylus include the file in it compilation process (as expected) ?

0

There are 0 best solutions below