marmelab / aor-rich-text-input

<RichTextInput> component for admin-on-rest, useful for editing HTML code in admin GUIs
MIT License
23 stars 25 forks source link

The package is crashed when importing at the existed admin on rest project code. #20

Closed ghost closed 6 years ago

ghost commented 6 years ago

I installed this package additionally at the existing aor project. But it was crashing when importing at the code. Following is dependencies and log from terminal.

"dependencies": {
    "admin-on-rest": "^1.4.0",
    "aor-loopback": "^1.3.2",
    "aor-rich-text-input": "^1.0.2",
ERROR in ./node_modules/aor-rich-text-input/lib/RichTextInput.css
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @import "~quill/dist/quill.snow.css";
| 
| .aor-rich-text-input .ql-editor {
 @ ./node_modules/aor-rich-text-input/lib/index.js 33:0-30
 @ ./client/containers/crud/talent.js
 @ ./client/containers/app.js
 @ ./client/index.js
 @ multi webpack-hot-middleware/client ./client/index
djhi commented 6 years ago

You need to configure webpack to handle css imports

djhi commented 6 years ago

PS: this has been made a lot easier in react-admin

ghost commented 6 years ago

Sorry, can you show more detailed code to put in the webpack configuration file?

fzaninotto commented 6 years ago

see https://github.com/marmelab/admin-on-rest/blob/master/example/webpack.config.js#L14

ghost commented 6 years ago

I tried to add the line to my webpack setting file, but it is not working. It shows same logs. screenshot 2018-05-30 19 08 40

I attached my webpack setting files. https://www.dropbox.com/sh/467csuew3o0wznk/AADaY-slDN_p46lEWQD15_Fea?dl=0

djhi commented 6 years ago

Have you installed the loaders packages ?

djhi commented 6 years ago

BTW, this kind of question should be asked on Stack overflow ;)