Open dan-kez opened 6 years ago
What about, if create task for nwb like as 'demo', which will be compile styles through webpack?
I'm having similar issues, here. @insin Any thoughts/comments on this issue? Thanks!
@insin is this feature something that can be configured/implemented w/ the current architecture of nwb
? Seems like there's a good amount of people trying to do this w/ components, but not much in the way of answers.... :-/
I'm struggling with this as well. I have a table component which heavily relies on CSS to style itself. So, I would like a way to package the stylesheet (SCSS) with the ES and Lib.
This might solve your problem #486
@aviskarkc10
This might solve your problem #486
That's a good solution, but when i use modifyVars in nwb.config.js, It doesn't seem to work
nwb.config.js
less: { javascriptEnabled: true, modifyVars: { themeFile: process.argv.includes('--params') ? path.resolve(__dirname, './src/theme/themes.less') : null, }, },
home.less
@import (optional) '@{themeFile}'
I am sorry I can't help you on this @Clairezyw. I used nwb
in one pet project of mine for which I needed to compile sass
and opened the PR because there wasn't any information out there. Maybe a maintainer of this project can help you. But this thread has been pretty inactive.
@insin
@samrith-s how to solve this problem?
I'm struggling with this as well. I have a table component which heavily relies on CSS to style itself. So, I would like a way to package the stylesheet (SCSS) with the ES and Lib.
@busyzz-1994 I stopped using this library 😄
This issue is a:
Hello!
I'm using nwb to build a component library for my team. I've run into an issue where a third party component is primarily theme-able via less / sass. I would like to generate a compile css file for this sass in my
es
/lib
directories. This would allow my library consumers to forgo installing / updating their webpack configs to support compiling sass files from the modules.Some additional information:
"nwb": "0.21.x",
nwb build-react-component --copy-files --keep-proptypes
I have attempted to do the above with the nwb-sass plugin. That said, I have not had success in generating css file in either the
es
orlib
directories.My current webpack config in
nwb.config.js
I would sincerely appreciate an example on how to configure my config to generate a css file given scss file or otherwise.
EDIT: Looking into this further it looks like webpackBuild isn't even being called when building the
es
andlib
directories. (see https://github.com/insin/nwb/blob/2c06dd4fd876c26e9ebfee5b1ad35950cd007c91/src/moduleBuild.js#L15 ).I don't have any interest in building a full UMD build but I do require the css styling. I'm assuming this would require a PR unless I've missed something.