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",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2"
|
||||||
"typescript": "^4.5.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@snowpack/plugin-typescript": "^1.2.1",
|
"@snowpack/plugin-typescript": "^1.2.1",
|
||||||
"@types/react": "^17.0.35",
|
"@types/react": "^17.0.35",
|
||||||
"@types/react-dom": "^17.0.11",
|
"@types/react-dom": "^17.0.11",
|
||||||
"eslint": "^8.2.0",
|
"eslint": "^8.2.0",
|
||||||
|
"jest": "^27.4.5",
|
||||||
"plugin-typescript": "^8.0.0",
|
"plugin-typescript": "^8.0.0",
|
||||||
"snowpack": "^3.8.8",
|
"snowpack": "^3.8.8",
|
||||||
"ts-jest": "^27.0.7"
|
"ts-jest": "^27.0.7",
|
||||||
|
"typescript": "^4.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root">Placeholder data</div>
|
<div id="root">Placeholder data</div>
|
||||||
<script src="/src/main.js"></script>
|
<script type="module" src="/dist/index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -4,7 +4,8 @@
|
||||||
/** @type {import("snowpack").SnowpackUserConfig } */
|
/** @type {import("snowpack").SnowpackUserConfig } */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mount: {
|
mount: {
|
||||||
/* ... */
|
public: { url: '/', static: true },
|
||||||
|
src: { url: '/dist' },
|
||||||
},
|
},
|
||||||
plugins: [
|
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,
|
"esModuleInterop": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"types": ["snowpack-env"],
|
||||||
|
"forceConsistentCasingInFileNames": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue