time-picker icon indicating copy to clipboard operation
time-picker copied to clipboard

You may need an appropriate loader to handle this file type

Open JakielaAdam opened this issue 7 years ago • 1 comments

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

JakielaAdam avatar Jun 21 '17 14:06 JakielaAdam

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>

nialloc9 avatar Sep 02 '17 14:09 nialloc9