Skip to content

Commit 91e07f2

Browse files
committed
setup tailwindcss and package.json
1 parent e64b241 commit 91e07f2

7 files changed

Lines changed: 102 additions & 4 deletions

File tree

package-lock.json

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

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,23 @@
1616
"magic-string": "^0.30.21",
1717
"mri": "^1.2.0",
1818
"node-addon-api": "^8.7.0",
19+
"phaser": "^3.90.0",
1920
"picocolors": "^1.1.1",
2021
"picomatch": "^4.0.4",
22+
"postcss": "^8.4.45",
2123
"source-map-js": "^1.2.1",
2224
"tailwindcss": "^4.2.2",
2325
"tapable": "^2.3.2"
2426
},
27+
"devDependencies": {
28+
"npm-run-all": "^4.1.5"
29+
},
2530
"scripts": {
26-
"start": "eleventy --serve",
27-
"build": "eleventy"
31+
"css:build": "tailwindcss -i ./src/assets/css/tailwind-input.css -o ./src/assets/css/tailwind.css",
32+
"css:watch": "tailwindcss -i ./src/assets/css/tailwind-input.css -o ./src/assets/css/tailwind.css --watch",
33+
"start": "npm-run-all --parallel css:watch eleventy:serve",
34+
"eleventy:serve": "eleventy --serve",
35+
"build": "npm run css:build && eleventy"
2836
},
2937
"repository": {
3038
"type": "git",

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

src/assets/css/tailwind-input.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

src/assets/js/init.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Initialize Phaser from npm package
2+
import('../../node_modules/phaser/dist/phaser.js').then((module) => {
3+
window.Phaser = module.default || module.Phaser;
4+
console.log('Phaser loaded from npm package (v' + window.Phaser.VERSION + ')');
5+
}).catch((error) => {
6+
console.error('Failed to load Phaser:', error);
7+
});

src/index.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ layout: false
77
<meta charset="UTF-8">
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
99
<title>Developer Directory</title>
10-
<script src="https://cdn.tailwindcss.com"></script>
11-
<script src="/assets/js/phaser.min.js"></script>
10+
<link rel="stylesheet" href="/assets/css/tailwind.css">
1211
<link rel="stylesheet" href="/assets/css/style.css">
12+
<script src="/assets/js/init.js" type="module"></script>
1313
</head>
1414
<body class="min-h-screen scroll-smooth bg-[var(--bg-page)] text-[var(--text-main)] transition-colors duration-300">
1515

tailwind.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
'./src/**/*.{njk,js,yaml}',
5+
'./src/**/*.html'
6+
],
7+
theme: {
8+
extend: {},
9+
},
10+
plugins: [],
11+
}

0 commit comments

Comments
 (0)