I have a response component and I publish the component in the NPM registry that I create with webpack. In my main project, I used the JS npm package component as follows:
Import myComp from 'myComp';
The problem is that myComp also has CSS, which I embed in dist/index.cssusing webpack and ExtractTextPlugin (which build all css into one file).
And I want to use the style as follows:
Import 'myComp/index.css';
or
Import 'myComp/index';
And in the myComp npm package, I want to expose it in a way that this import method will support.
NOTE. I do not want to import it directly fromnode_modules
Import '../../../node_modules/myComp/index.css';
Thank!
David source
share