Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda