in my Main.less file I tried @import '/node_modules/react-select/react-select.min.css';
I get the message Resource interpreted as Stylesheet but transferred with MIME type text/html: "https://localhost/node_modules/react-select/react-select.min.css".
The styles don’t appear visually. How do I go about importing this css ?
An alternative to copying the css file, is creating a symbolic link from somewhere in your meteor project, to the css file in the node_modules folder. You can check this symbolic into git, and meteor will pick it up like a normal file.
Just hit the same issue, I need to import the css from a react control. How do you actually go about creating a symlink? Is that a file shortcut/pointer at the filesystem level or is it a line you add to one of the config files?
Ok so first identify the css file(s) you need in the node_modles/your-react-control folder. Then, from somewhere in your Meteor project, for example a client/styles folder
osx, create a symlink in the terminal:
# we are in my-meteor-project/client/styles
ln -s ../../node_modles/your-react-control/dist/styles.css your-react-control.css
There is an issue open for this already: https://github.com/meteor/meteor/issues/6037, it looks like @benjamn has put this into a post-1.3 bucket and will come back to it after 1.3… Maybe we can all add our thoughts in the Github issue, seems like importing CSS for a native NPM package would be important for 1.3 imo.