Skip to content

Commit 80b2916

Browse files
committed
Initial commit: Nix-powered React app
1 parent 663a7b5 commit 80b2916

File tree

7 files changed

+798
-65
lines changed

7 files changed

+798
-65
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
node_modules/
3+
dist/
4+
5+
# Environment
6+
.env
7+
.env.local
8+
9+
# Logs
10+
*.log
11+
12+
# Editor directories and files
13+
.vscode/
14+
.idea/
15+
*.suo
16+
*.ntvs*
17+
*.njsproj
18+
*.sln
19+
*.sw?
20+
21+
# Nix
22+
result

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

something.nix

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/App.jsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import React from 'react'
2-
import ReactDOM from 'react-dom/client'
3-
import App from './App'
42

5-
ReactDOM.createRoot(document.getElementById('root')).render(
6-
<React.StrictMode>
7-
<App />
8-
</React.StrictMode>
9-
)
3+
function App() {
4+
return (
5+
<div>
6+
<h1>Hello from Nis!</h1>
7+
<p>This app was built and deployed using Nix</p>
8+
</div>
9+
)
10+
}
11+
12+
export default App

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
</head>
88
<body>
99
<div id="root"></div>
10-
<script type="module" src="/src/main.jsx"></script>
10+
<script type="module" src="./main.jsx"></script>
1111
</body>
1212
</html>

src/vite.config.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import React from 'react'
1+
import { defineConfig } from 'vite'
2+
import react from '@vitejs/plugin-react'
23

3-
function App() {
4-
return (
5-
<div>
6-
<h1>Hello from Nix!</h1>
7-
<p>This app was built and deployed using Nix</p>
8-
</div>
9-
)
10-
}
11-
12-
export default App
4+
export default defineConfig({
5+
plugins: [react()],
6+
esbuild: {
7+
loader: 'jsx',
8+
include: /src\/.*\.jsx?$/,
9+
}
10+
})

0 commit comments

Comments
 (0)