Keep "import css" line to the output file?
See original GitHub issueRollup Config
export default {
input: "src/index.js",
output: {
file: "dist/index.js",
format: "cjs"
},
plugins: [
postcss({
extract: true
})
]
};
src/index.js
import "./index.less";
Expected bundle
require("./index.css")
- But the actual result is an empty bundle
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:11
Top Results From Across the Web
import .css file into .less file - Stack Overflow
If you want to import a CSS file, and don't want LESS to process it, just use the .css extension: @import "lib.css"; The...
Read more >Including .css files with @import is non-standard behaviour ...
Our recommendation is to not import .css files. Doing so makes you're code non-portable and tightly couples you to a specific implementation. In ......
Read more >How to include one CSS file in another? - GeeksforGeeks
Yes, It is possible to include one CSS file in another and it can be done multiple times. Also, import multiple CSS files...
Read more >Sass: @import
Sass extends CSS's @import rule with the ability to import Sass and CSS stylesheets, providing access to mixins, functions, and variables and combining ......
Read more >CSS, SCSS, and Less support in Visual Studio Code
At this point, if you create and/or modify Less or SASS files, you see the respective CSS files generated and/or changes reflected on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The production use is this @Himself65
At the moment most library authors bundle an entire styles.css file which is all the styles needed for all their components; This is not ideal as it imports styles for components the consumer isn’t using into their project.
If the requires(“.css”) statements are left in the output library consumers will automatically import only the critical css that they need as they import the components they want.
To get around this i issue iv’e created a hack work around which works for me in the meantime.
We leave the actual
.module.scss
files in the output in our usecase but it looks something like this as our own rollup plugin and we turned off rollup-plugin-postcss