basic build process
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
.DS_Store
|
||||||
|
.vscode/
|
3
babel.config.json
Normal file
3
babel.config.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"presets": ["@babel/preset-env", "@babel/preset-react"]
|
||||||
|
}
|
28
index.html
Normal file
28
index.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<style>
|
||||||
|
#root {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
#target,
|
||||||
|
#editor {
|
||||||
|
width: 50%;
|
||||||
|
height: 100%;
|
||||||
|
margin: 5px;
|
||||||
|
border: 1px solid #000000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root">
|
||||||
|
<div id="target">render target</div>
|
||||||
|
<div id="editor" />
|
||||||
|
</div>
|
||||||
|
<script src="dist/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
24
package.json
Normal file
24
package.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"name": "editor-playground",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"repository": "git@git.yetaga.in:alazyreader/editor-playground.git",
|
||||||
|
"author": "David Ashby <delta.mu.alpha@gmail.com>",
|
||||||
|
"scripts": {
|
||||||
|
"build": "yarn run webpack"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/cli": "^7.28.3",
|
||||||
|
"@babel/core": "^7.28.4",
|
||||||
|
"@babel/preset-env": "^7.28.3",
|
||||||
|
"@babel/preset-react": "^7.27.1",
|
||||||
|
"@monaco-editor/react": "^4.7.0-rc.0",
|
||||||
|
"babel-loader": "^10.0.0",
|
||||||
|
"monaco-editor": "0.53.0",
|
||||||
|
"react": "^19.1.1",
|
||||||
|
"react-dom": "^19.1.1",
|
||||||
|
"webpack": "^5.101.3",
|
||||||
|
"webpack-cli": "^6.0.1"
|
||||||
|
}
|
||||||
|
}
|
15
src/index.js
Normal file
15
src/index.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import Editor from "@monaco-editor/react";
|
||||||
|
import { createRoot } from "react-dom/client";
|
||||||
|
|
||||||
|
function App() {
|
||||||
|
return (
|
||||||
|
<Editor
|
||||||
|
height="90vh"
|
||||||
|
defaultLanguage="javascript"
|
||||||
|
defaultValue="// some comment"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const rootElement = document.getElementById("editor");
|
||||||
|
createRoot(rootElement).render(<App />, rootElement);
|
18
webpack.config.js
Normal file
18
webpack.config.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
module.exports = {
|
||||||
|
entry: "./src/index.js",
|
||||||
|
mode: "development",
|
||||||
|
output: {
|
||||||
|
filename: "main.js",
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.jsx?$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: {
|
||||||
|
loader: "babel-loader",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
Reference in New Issue
Block a user