Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

295
Vistas
How to change default location of svelte css in rollup.config.js?

I'm using svelte compoenents in some pages of myapp. the directory tree is like:

-myapp
--controller
--static
--svelte

I have manged to setup svelte to ouput js bundle to myapp/static/js/ by modifying rollup.config.js:

export default {
    input: 'src/main.js',
    output: {
        sourcemap: true,
        format: 'iife',
        name: 'app',
        file: '../static/js/bundle.js'

However the styles in components is also saved in myapp/static/js which is not very idomatic. So I want to change the location to myapp/static/css

Currently css is defined as:

plugins: [
    svelte({
        compilerOptions: {
            // enable run-time checks when not in production
            dev: !production
        }
    }),
    css({ output: 'bundle.css' }),

I tried things like:

css({  
    output: {
        file: '../static/css/bundle.css'
    },          
 }),

But I get this error:

bundles src/main.js → ../static/js/bundle.js...
[!] (plugin css) Error: The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "../static/js/bundle.css".

So I'm wondering what is the correct way to do that?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda