-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to input and output multiple files? #79
Comments
Really wish this was a thing too... Made an issue without reading/looking to see if there already was one. Regardless. It would be nice to have this feature! |
Yeah this is something im currently looking for? is there any update to this? |
@vincelawdev @frankypixels @The-Code-Monkey @thgh example - index.js import "file1.scss "; import "file2.scss "; //rollup.config.js output: function (styles, styleNodes) { // Loop through all the style nodes (SCSS imports) Object.keys(styleNodes).forEach( (styleNode) => { const scssFilePath = styleNode; // Derive the output CSS file name from the SCSS file name const cssFileName = scssFilePath .split("/") .pop() // Get the file name .replace(".scss", ".min.css"); // Replace .scss extension with .min.css // Write each CSS file to disk ( sample path ) const cssOutputPath = path.resolve( __dirname, "./assets/output/css", cssFileName ); try { const result = sass.renderSync({ file: scssFilePath }); writeFileSync(cssOutputPath, result.css.toString()); } catch (err) { console.error("Sass compilation error:", err.message); process.exit(1); } }); } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am moving over to rollup from gulp.
I was wondering if it might be possible to get two or more separate input .scss files to output to two or more separate .css files?
file1.scss -> file1.css
file2.scss -> file2.css
Thanks in advance.
The text was updated successfully, but these errors were encountered: