Like https://github.com/rotundasoftware/parcelify
E.g. I have @import url("~nanoscroller"); in my css. I expect that to use the style field in that package's package.json. Instead, that module's JS was included in my css.
+1
+1
+1
+1
+1
Is there any talk on supporting this in Webpack?
Would one of the authors of this package be willing to suggest how they would suggest go about approaching this? I'm willing to give it a ago, since as a library author myself, this will make my distribution documentation much easier.
One thing that I'm not clear on though is what is require('myModule')'s package.json contains both a main and a style property. My feeling is that it should pull in both the CSS and the JS...
+1
ping @jonathantneal :)
Any updates on the thread?
I can confirm. The feature is available at least since Webpack 3.5.1 with is currently used in Create-react-app.
@just-boris - I don't see css-loader in the create-react-app dependencies. I'm trying to get it working and if they are using it, I might be able to follow along as an example.
@d3viant0ne - Could you possibly confirm why this was closed? Has it been implemented now - I don't see anything in the recent commits related to it, but I might just be missing it. Or was it closed as this feature not going to be implemented?
@DataTables
css-loader in create-react-app: https://github.com/facebookincubator/create-react-app/blob/54f7da9bb92f0c809fb24c7f22d7457acbfe851f/packages/react-scripts/package.json#L33
style field usage example: https://github.com/necolas/normalize.css/blob/73b6b0c7e8690ab5005bca9d7e13d3fb319c98ac/package.json#L6
Most helpful comment
Would one of the authors of this package be willing to suggest how they would suggest go about approaching this? I'm willing to give it a ago, since as a library author myself, this will make my distribution documentation much easier.
One thing that I'm not clear on though is what is
require('myModule')'s package.json contains both amainand astyleproperty. My feeling is that it should pull in both the CSS and the JS...