Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit eb242cf

Browse files
authored
Merge pull request #84 from SwiftDocOrg/cssnano-plugin
Update Asset Pipeline Configuration
2 parents 5da4946 + d29dd5f commit eb242cf

File tree

7 files changed

+9
-1196
lines changed

7 files changed

+9
-1196
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
xcuserdata/
66
.swiftpm
77

8+
Resources/*.css
9+
!Resources/*.min.css
10+
811
# NodeJS
912
## Logs
1013
logs

.node/package-lock.json

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

.node/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
"not dead"
66
],
77
"scripts": {
8-
"build": "postcss ../Assets/css/all.css -o ../Resources/all.min.css --config ./postcss.config.js -u cssnano",
9-
"watch": "postcss -w ../Assets/**/*.css --dir ../Resources --config ./postcss.config.js "
8+
"watch": "postcss -w ../Assets/**/*.css -o ../Resources/all.min.css --config ./postcss.config.js"
109
},
1110
"dependencies": {
1211
"cssnano": "^4.1.10",
1312
"postcss-cli": "^7.1.0",
14-
"postcss-nested": "^4.2.1",
1513
"postcss-preset-env": "^6.7.0"
1614
}
1715
}

.node/postcss.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module.exports = {
22
plugins: [
3-
require("postcss-nested"),
43
require("postcss-preset-env")({
54
stage: 0,
65
features: {
76
"matches-pseudo-class": false,
87
},
98
}),
9+
require("cssnano")({
10+
preset: "default",
11+
}),
1012
],
1113
};

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,8 @@ $ npm run watch
279279
```
280280

281281
When you're happy with the results,
282-
run the `build` script to generate production-ready assets.
283-
284-
```terminal
285-
$ npm run build
286-
```
287-
288-
Finally,
289282
commit any changes to the source files in `Assets`
290-
as well as the generated files in `Resources`.
283+
as well as the generated files in `Resources`.
291284

292285
```terminal
293286
$ git add Assets Resources

0 commit comments

Comments
 (0)