question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

css file written to wrong output folder

See original GitHub issue

my config:

import svelte from 'rollup-plugin-svelte'
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

export default {
    input: 'src/main.js',
    output: {
        file: 'js/main.min.js',
        name: 'app',
        format: 'iife'
    },
    plugins: [
        svelte({
	    css: css => {
		css.write('css/bundle.css', false);
	    }
        }),
        resolve({
	    browser: true,
	    dedupe: ['svelte']
	}),
	commonjs()
    ]
};

I expect that css.write('css/bundle.css', false); writes the css file relative to the root folder. Actually it is writing it relative to the output folder of the js file: ‘js/css/bundle.css’.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
matthscommented, Oct 4, 2020

@Conduitry, it is definitely confusing and it doesn’t answer the question on how to achieve the desired behavior of @Gamadril at all? So how can the css file be in a css/ not js/css/ while the javascript file goes to js/?

3reactions
benmccanncommented, Nov 18, 2020

We’re planning to remove the css option. A better way to handle is to emit the CSS styles into a virtual file (via emitCss: true), and have another Rollup plugin – for example, rollup-plugin-css-only, rollup-plugin-postcss, etc. – take responsibility for the new stylesheet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I change sass output directory? - Stack Overflow
I want the sass output to go to the css folder, but each time I run sass watcher it creates a new css...
Read more >
How to Fix CSS file is not Working with HTML in Chrome
Fix CSS file is not Working with HTML in Chrome | Problem Solved Show SupportBuy Me a COFFEE: https://buymeacoffee.com/Webjahin  ...
Read more >
HTML Styles CSS - W3Schools
Cascading Style Sheets (CSS) is used to format the layout of a webpage. ... External - by using a <link> element to link...
Read more >
MiniCssExtractPlugin - webpack
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS...
Read more >
Dart Sass Command-Line Interface
By default, error CSS is enabled if you're compiling to at least one file on disk (as opposed to standard output). You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found