-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat: support for multiple entry files #264
feat: support for multiple entry files #264
Conversation
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
==========================================
+ Coverage 92.47% 92.83% +0.35%
==========================================
Files 10 10
Lines 319 335 +16
Branches 112 115 +3
==========================================
+ Hits 295 311 +16
Misses 23 23
Partials 1 1
Continue to review full report at Codecov.
|
cd989f6
to
940b216
Compare
5dd0e27
to
840778c
Compare
5326e94
to
81b9f90
Compare
Made so that it concatenates the css file if |
81b9f90
to
45591f2
Compare
d060cbb
to
0d88220
Compare
Bundle multiple bundles for multiple input entries.
0d88220
to
2ff9c36
Compare
@SASUKE40 fixed up the warnings, but will do some refactoring and will add more tests for this use case. There are quite a few different cases with this so would be good to cover them. Also removed the |
Looks great, thanks a lot! |
🎉 This PR is included in version 3.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
epic - living the OSS dream 🎉 |
This latest commit (3ea986c) seems to break for me, and is outputting empty css files. Is this a regression? Any help would be appreciated. rollup.config.js:
src/pages/test.js:
src/styles/main.less:
the resulting file is zero bytes, or when a sourcemap is used, it's
Thanks! |
I am experiencing the same issue after updating to v3.1.0 |
@MichaelAnd @emjaksa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of test snapshots leads to pass test cases about extract empty files.
Was this happening with only |
scss files didn't work either, with a simple:
(I'm on node v13.7.0, if that helps) |
@MichaelAnd just had a quick look at it. So the issue isn't the transpiled files. I think this happens with cases where css is not imported as named module E.G. Will have a look this 😉 |
The fix for single bundle won't be to complicated. But there are few cases which would need to cover better when there are mixed imports like: import baz from './style.css'
import 'foo.css' |
My setup is broken again too, it worked until about a week ago, then stopped working, then worked until yesterday now, with v3.1.1 it's broken again. I was always on the latest version and didn't change anything on my codebase over the last two weeks. I'm using rollup-plugin-postcss with Tailwind, where I have my Tailwind config in a file with some top imports where I include Tailwind utils etc. // tailwind.css
@import "tailwindcss/base";
@import "tailwindcss/components";
@import './components';
@import "tailwindcss/utilities";
@import './edm-utilities';
... more config ... The second step is that this file is then included in my javascript code like this inside server.js // server.js
import './css/tailwind.css'
import * as sapper from '@sapper/server'
import express from 'express'
... more code and config ... And then I build it with rollup and this is where it stopped working with v3.1.1 again even though it worked for the last two or so days before v3.1.1 again. Here is my rollup conf with the With v3.1.1 it doesn't write/output the |
Could you find global.css related to your bundle root ? |
My setup hasn't changed for about 8 months now, just the npm packes got upgraded on a regular. So a week ago using Summary: It worked until v2.8.2. which broke my setup: #250 (comment) Then I switched to not using current rollup conf snippet...
postcss({
plugins: postcssPlugins(!dev),
extract: 'static/global.css', <--- this worked with the version after 2.8.2 and before 3.1.1
}), And now, with the current version v3.1.1 it's broken again i.e. no |
Try to downgrade the plugin, I would solve it ASAP in yarn add rollup-plugin-postcss@2 -dev |
So I did. I'm now on version v2.9.0 and it works again i.e. my So this works with v2.9.0 but breaks my site with v3.1.1 ... other rollup code see gist above...
postcss({
plugins: postcssPlugins(!dev),
extract: 'static/global.css', <--- works with v2.9.0 but breaks my site with v3.1.1
}),
... other rollup.config code see gist above... |
Continuing on the work of #230
This is a basic example for support for bundling multiple css files based on the number of entries. Rationale being that if you are using js modules and might have multiple entries you might not need to load all of the css at once. This would be handled in some user chosen way.
There is one question though, how to handle the
extract: "some/custom/path"
in such cases:extract
being a string fall back to single css file output.Would need more input from the team on this.