-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update dependencies & fix bundle import issue (#267).
- Loading branch information
1 parent
2a5b7c5
commit 7484096
Showing
3 changed files
with
123 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<script src="https://unpkg.com/@babel/[email protected]/babel.min.js" crossorigin></script> | ||
<script src="https://unpkg.com/[email protected]/umd/react.development.js" crossorigin></script> | ||
<script src="https://unpkg.com/[email protected]/umd/react-dom.development.js" crossorigin></script> | ||
<script src="https://codemirror.net/6/codemirror.js"></script> | ||
<script src="https://unpkg.com/@uiw/react-codemirror/dist/codemirror.min.js"></script> | ||
</head> | ||
<body> | ||
<div id="container" style="padding: 24px"></div> | ||
<script> | ||
window.require = function (module) { | ||
if (!module) { | ||
throw new Error('this is a fake require only use for import fusion next'); | ||
} | ||
if (window.CM && window.CM[module]) { | ||
return window.CM[module]; | ||
} | ||
return window[module]; | ||
}; | ||
</script> | ||
<script type="text/babel"> | ||
import CodeMirror from '@uiw/codemirror'; | ||
import { javascript } from '@codemirror/lang-javascript'; | ||
|
||
const Demo = () => { | ||
return ( | ||
<div> | ||
<CodeMirror | ||
value="console.log('hello world!')" | ||
height="200px" | ||
extensions={[javascript({ jsx: true })]} | ||
onChange={(value, viewUpdate) => { | ||
console.log('value:', value); | ||
}} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
ReactDOM.render(<Demo />, document.getElementById('container')); | ||
</script> | ||
</body> | ||
</html> |