JedWatson / react-codemirror

Codemirror Component for React.js
MIT License
1.56k stars 262 forks source link

How to use with postcss #120

Open jacargentina opened 7 years ago

jacargentina commented 7 years ago

Using postcss in my React app, and then when i do

import codemirrorstyles from 'codemirror/lib/coremirror.css'

the classes are already processed, so there is no class CodeMirror, etc.

vpotravnyy commented 7 years ago

You just need to import it without postcss processing. Add following rule to your webpack config:

rules: [
  ...
  {
    test: /node_modules\/.*\.css$/,
    use: [
      'style-loader',
      'css-loader'
    ]
  }
]