-
-
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
WIP: feat: use multiEntry input #276
WIP: feat: use multiEntry input #276
Conversation
Best reviewed: commit by commit
|
09be2d0
to
fd456ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #276 +/- ##
==========================================
+ Coverage 92.47% 92.77% +0.29%
==========================================
Files 10 10
Lines 319 332 +13
Branches 112 115 +3
==========================================
+ Hits 295 308 +13
Misses 23 23
Partials 1 1
Continue to review full report at Codecov.
|
@atompkins @BogdanDarius @daviddelusenet @MichaelAnd @emjaksa this PR is based on the previous one with fixes for the empty imports. I passes the current test suite, but still needs more tests. Could you please verify it works for you and if possible provide some repro of your setups? |
fd456ef
to
af4c6bc
Compare
af4c6bc
to
d2c09a2
Compare
I've just quickly swapped this out on the project i'm working on at the moment (so not a slimmed down case), but it's come through with an empty CSS file again:
but strangely, with a corresponding site.css.map file:
This setup probably isn't regular (custom static site gen plugin), so I'll try and get you a slimmed down reproduction later on. Here's the css part of my conf at the moment:
|
I've put a stripped-down build here: https://github.com/michaeland/postcss-test to test, I cloned your repo, switched to the On the face of it, it seems like it doesn't like any css imports that aren't at the top level. For example, if I include another js file from the main entry point: in
in
That results in an empty
but if I skip out the
That results in the correct css file:
Hope that helps! |
Had to add |
Hi, how soon are you planning to release this feature? |
Can't say for sure. There are some issues from rollup v2 which make it a bit more complicated to work for all the current cases. |
Closing this as there are alternatives for this plugin. Found out that https://github.com/Anidetrix/rollup-plugin-styles does the 80% of what I needed so won't be continuing with this as there are a lot of thing which need to be updated for it to work correctly. |
and where is multy entry support in rollup-plugin-styles? I didnt find any example of it |
It uses the fact that rollup has ability to understand input as object E.G. input: {
entry1: 'path/to/entry1.js'
entry2: 'path/to/entry2.js'
// and so on
} Any of the styles used in those entries will be genrated and put next to the entry. To set asset name you can use assetFilenames this also understands slashes in it and will create corresponding directories. From personal usecase const moduleOutput = {
format: 'esm',
dir: 'dist',
entryFileNames: 'resources/vertical/[name]/LOCAL/index.mjs',
chunkFileNames: 'vendor/[name].[hash].js',
assetFileNames: 'resources/vertical/[name]/LOCAL/index[extname]',
sourcemap: true,
}; hope this helps |
is there any way to rewrite it with regexp? for example:
i did not find, thats why have been using |
I don't think it supports the regexes or minimatch patterns. At least I haven't tried and it's not mentioned in documentation. In my case it's a mono-repo where every package is build separately and is corresponding to module in the app. Rollup config is just a plain javascript, so you can implement some sort of lookup for your modules and build the
It it definitely hard to tell why the output is single file without knowing your config for both inputs and outputs. |
to my mind this should be done by library
i have multiple files and every of them should be as output file and what you advised
is not the best solution |
Someone already had similar issue in rollup issues I think it's possible to achieve what you want with @rollup/multi-entry and setting entryFileNames, assetFilenames and chunkFileNames. Build tools shouldn't do everything, rollup provides excellent plugin system to prevent bloat in its code. |
Another take on multientry input. Keeping in draft as it needs more tests