Set up a basic typescript build
This commit is contained in:
parent
e8d77699a9
commit
2483d8d0d9
|
@ -1 +1,2 @@
|
|||
**/target
|
||||
node_modules
|
||||
target
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,16 +12,17 @@
|
|||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"typescript": "^4.5.2"
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@snowpack/plugin-typescript": "^1.2.1",
|
||||
"@types/react": "^17.0.35",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
"eslint": "^8.2.0",
|
||||
"jest": "^27.4.5",
|
||||
"plugin-typescript": "^8.0.0",
|
||||
"snowpack": "^3.8.8",
|
||||
"ts-jest": "^27.0.7"
|
||||
"ts-jest": "^27.0.7",
|
||||
"typescript": "^4.5.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root">Placeholder data</div>
|
||||
<script src="/src/main.js"></script>
|
||||
<script type="module" src="/dist/index.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -4,7 +4,8 @@
|
|||
/** @type {import("snowpack").SnowpackUserConfig } */
|
||||
module.exports = {
|
||||
mount: {
|
||||
/* ... */
|
||||
public: { url: '/', static: true },
|
||||
src: { url: '/dist' },
|
||||
},
|
||||
plugins: [
|
||||
/* ... */
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import React from "react"
|
||||
import ReactDOM from "react-dom"
|
||||
|
||||
const Main = () => <>
|
||||
<h1>Numenera Datasphere</h1>
|
||||
<div>Campaign Settings</div>
|
||||
<div>Player Characters</div>
|
||||
<div>Cyphers and Artifacts</div>
|
||||
</>;
|
||||
|
||||
const main = () => {
|
||||
ReactDOM.render(<Main />, document.getElementById('root'))
|
||||
}
|
||||
|
||||
console.log(document.getElementById('root'))
|
||||
main()
|
|
@ -1,11 +0,0 @@
|
|||
import React from "react"
|
||||
import ReactDOM from "react-dom"
|
||||
|
||||
const Hello = () => <div>Hello</div>;
|
||||
|
||||
const main = () => {
|
||||
ReactDOM.render(<Hello />, document.getElementById('root'))
|
||||
}
|
||||
|
||||
console.log(document.getElementById('root'))
|
||||
main()
|
|
@ -7,6 +7,9 @@
|
|||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"types": ["snowpack-env"],
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue