Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!