michalkvasnicak / babel-plugin-css-modules-transform

Extract css class names from required css module files, so we can render it on server.
MIT License
326 stars 54 forks source link

Import CSS from node_modules doesn't work #74

Closed grundiss closed 6 years ago

grundiss commented 6 years ago

Hi! I'm trying to use plugin-css-modules-transform@1.3.1 with react-fa@5.0.0, and it doesn't seem to work as expected as I keep getting error:

/Users/grundiss/Sites/lilenko.ru/node_modules/font-awesome/css/font-awesome.css:7
@font-face {
^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:152:10)
    at Module._compile (module.js:624:28)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/grundiss/Sites/lilenko.ru/node_modules/react-fa/lib/index.js:8:1)
[nodemon] app crashed - waiting for file changes before starting...

Here's my .babelrc

{
  "presets": ["env", "react"],
  "plugins": [
    ["module-resolver", {"root": ["./src"]}],
    ["css-modules-transform", {"generateScopedName": "[local]_[hash:base64:5]"}],
    ["inline-json-import", {}]
  ]
}

What do I do wrong? I'd really appreciate some help here. You can clone my repo https://github.com/grundiss/lilenko_ru to take I look into a full code base (yarn install && yarn build-server && yarn start-watch).

aIacoella commented 4 years ago

Hi, any news on this issue?