Skip to content

Commit e387803

Browse files
committed
feat: optimize build process and enhance Tailwind CSS configuration
1 parent c0951f6 commit e387803

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ If you prefer to install **Demofl.io** manually or improve the extension, follow
5959
```
6060
3. **Install Dependencies:**
6161
```bash
62-
npm init -y
63-
npm install webpack webpack-cli --save-dev
64-
npm install cssnano postcss --save-dev
65-
npm install css-minimizer-webpack-plugin --save-dev
62+
npm install
6663
```
6764
4. **Build the Project:**
6865
```bash

postcss.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ module.exports = {
33
require('tailwindcss'),
44
require('autoprefixer'),
55
require('cssnano')({
6-
preset: 'default',
6+
preset: ['default', {
7+
discardComments: {
8+
removeAll: true,
9+
},
10+
normalizeWhitespace: true,
11+
minifyFontValues: true,
12+
colormin: true
13+
}]
714
}),
815
]
916
}

tailwind.config.js

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
2-
content: ["./html/**/*.html", "./js/**/*.js"],
2+
content: [
3+
"./html/**/*.html",
4+
"./js/**/*.js"
5+
],
36
theme: {
47
extend: {},
58
},
@@ -13,5 +16,18 @@ module.exports = {
1316
base: true,
1417
styled: true,
1518
utils: true
19+
},
20+
purge: {
21+
enabled: true,
22+
content: [
23+
"./html/**/*.html",
24+
"./js/**/*.js"
25+
],
26+
options: {
27+
safelist: [],
28+
blocklist: [],
29+
keyframes: true,
30+
fontFace: true
31+
}
1632
}
1733
}

webpack.config.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,20 @@ module.exports = [{
3737
]
3838
},
3939
optimization: {
40+
minimize: true,
4041
minimizer: [
41-
`...`,
42-
new CssMinimizerPlugin()
42+
'...',
43+
new CssMinimizerPlugin({
44+
minimizerOptions: {
45+
preset: [
46+
'default',
47+
{
48+
discardComments: { removeAll: true },
49+
normalizeWhitespace: true
50+
},
51+
],
52+
},
53+
})
4354
]
4455
},
4556
mode: 'production'

0 commit comments

Comments
 (0)