Skip to content

Commit f0c68a4

Browse files
committed
Update Tailwind to v3
1 parent d6e168e commit f0c68a4

File tree

7 files changed

+91
-300
lines changed

7 files changed

+91
-300
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ prod-build:
2525
cp public/favicon-16x16.png docs
2626
cp public/favicon-32x32.png docs
2727
cp public/favicon-96x96.png docs
28+
node replace-css.js
2829

2930
.PHONY: dev-setup dev-watch prod-setup prod-build

package-lock.json

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

package.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
{
22
"license": "MIT",
33
"scripts": {
4-
"dev": "npm run development",
5-
"development": "mix",
4+
"dev": "mix",
65
"watch": "mix watch",
7-
"watch-poll": "mix watch -- --watch-options-poll=1000",
8-
"hot": "mix watch --hot",
9-
"prod": "npm run production",
10-
"production": "mix --production"
6+
"prod": "mix --production"
117
},
128
"devDependencies": {
13-
"autoprefixer": "^10.0.2",
14-
"browser-sync": "^2.26.13",
15-
"browser-sync-webpack-plugin": "2.2.2",
16-
"laravel-mix": "^6.0.6",
17-
"postcss": "^8.1.14",
18-
"tailwindcss": "^2.0.2"
9+
"autoprefixer": "^10.4.4",
10+
"browser-sync": "^2.27.10",
11+
"browser-sync-webpack-plugin": "^2.3.0",
12+
"laravel-mix": "^6.0.48",
13+
"postcss": "^8.4.12",
14+
"tailwindcss": "^3.0.23"
1915
}
2016
}

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+
}

replace-css.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const fs = require("fs");
2+
const manifest = require('./public/mix-manifest.json');
3+
4+
let indexHtml = fs.readFileSync('./docs/index.html', 'utf8');
5+
6+
indexHtml = indexHtml.replace('/app.css', manifest['/app.css']);
7+
8+
fs.writeFileSync('./docs/index.html', indexHtml);

tailwind.config.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const colors = require('tailwindcss/colors');
22

33
module.exports = {
4-
purge: [
4+
content: [
55
'./public/**/*.html',
66
],
77
darkMode: 'media', // or 'media' or 'class'
88
theme: {
99
colors: {
1010
white: colors.white,
1111
black: colors.black,
12-
gray: colors.coolGray,
12+
gray: colors.gray,
1313
orange: colors.orange,
1414
blue: colors.blue,
1515
logo: {
@@ -18,9 +18,5 @@ module.exports = {
1818
300: '#cc9a60',
1919
}
2020
},
21-
},
22-
variants: {
23-
extend: {},
24-
},
25-
plugins: [],
21+
}
2622
}

webpack.mix.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
const mix = require('laravel-mix');
22

3-
const tailwindcss = require('tailwindcss');
4-
5-
mix.disableNotifications();
6-
7-
mix.postCss('resources/css/app.css', 'public', [
8-
tailwindcss('./tailwind.config.js')
9-
]);
3+
mix
4+
.disableNotifications()
5+
.setPublicPath('public/')
6+
.postCss('resources/css/app.css', 'public', [
7+
require('tailwindcss'),
8+
]);
109

1110
mix.browserSync({
1211
proxy: 'cuyz.test', // valet link
@@ -17,3 +16,7 @@ mix.browserSync({
1716
'public/index.html',
1817
]
1918
});
19+
20+
if (mix.inProduction()) {
21+
mix.version();
22+
}

0 commit comments

Comments
 (0)