time-picker
time-picker copied to clipboard
You may need an appropriate loader to handle this file type
Hi,
I am trying to replicate the 12 hour picker example into my project. I have everything installed and the project runs fine. However, when I try to import the css given in that example:
import 'rc-time-picker/assets/index.css';
...I get the following error:
VM33435:1 Uncaught Error: Module parse failed: /path/to/project/node_modules/rc-time-picker/assets/index.css Unexpected token (1:0) You may need an appropriate loader to handle this file type. | .rc-time-picker { | display: inline-block; | box-sizing: border-box; at eval (eval at <anonymous> (bundle.js:13
Has anyone else seen this issue and solved it? I am running react": "^15.6.1
.
Thank you
I was able to solve this using 'babel-plugin-inline-import' plugin.
npm install babel-plugin-inline-import --save-dev
Then inside my babelrc file I added the plugin:
[ "inline-import", { "extensions": [".css"] } ]
Then inside the head of my application I added in the style:
import timepickerStyle from 'rc-time-picker/assets/index.css';
<Head><style dangerouslySetInnerHTML={{__html: timepickerStyle}} /></Head>