Css-loader: [Discussion] Use style field in package.json

Created on 11 May 2015  路  14Comments  路  Source: webpack-contrib/css-loader

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.

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 a main and a style property. My feeling is that it should pull in both the CSS and the JS...

All 14 comments

+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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heldrida picture heldrida  路  4Comments

Naspo88 picture Naspo88  路  3Comments

osenvosem picture osenvosem  路  4Comments

Jessidhia picture Jessidhia  路  3Comments

Bhushankumar-pawar picture Bhushankumar-pawar  路  3Comments