Codemirror + react

I’m trying to import codemirror in react. but webpack seems to bug this.
Failed to compile.

./src/resources/codemirror/lib/codemirror.js
Line 11:3: Expected an assignment or function call and instead saw an expression no-unused-expressions
Line 12:35: ‘define’ is not defined
no-undef
Line 12:48: ‘define’ is not defined
no-undef
Line 13:23: Unexpected use of ‘self’
no-restricted-globals
Line 2532:27: Unexpected use of ‘screen’
no-restricted-globals
Line 2533:9: Unexpected use of ‘screen’
no-restricted-globals
Line 2533:31: Unexpected use of ‘screen’
no-restricted-globals
Line 2535:18: Unexpected use of ‘screen’
no-restricted-globals
Line 2535:39: Unexpected use of ‘screen’
no-restricted-globals
Line 2536:18: Unexpected use of ‘screen’
no-restricted-globals
Line 2536:39: Unexpected use of ‘screen’
no-restricted-globals
Line 5481:30: Expected an assignment or function call and instead saw an expression no-unused-expressions

Search for the keywords to learn more about each error.