Skip to content

Commit

Permalink
build: compress css files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Sep 19, 2024
1 parent 7215129 commit 71c620c
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"prettier": "^3.3.3",
"prettier-config-vuepress": "^5.0.0",
"rimraf": "^6.0.1",
"sass": "1.79.1",
"sass-embedded": "1.79.1",
"sort-package-json": "^2.10.1",
"stylelint": "^16.9.0",
"stylelint-config-hope": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion plugins/blog/plugin-comment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/features/plugin-back-to-top/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"copy": "cpx \"src/**/*.svg\" lib",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/features/plugin-catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/features/plugin-copy-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"copy": "cpx \"src/**/*.svg\" lib",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/features/plugin-notice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"copy": "cpx \"src/**/*.svg\" lib",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/features/plugin-photo-swipe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-hint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@mdit/plugin-alert": "^0.13.1",
Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@mdit/plugin-figure": "^0.13.1",
Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-markdown-math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@mdit/plugin-katex-slim": "^0.13.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compileString } from 'sass'
import { compileString } from 'sass-embedded'
import { fs, getDirname, path } from 'vuepress/utils'

const __dirname = getDirname(import.meta.url)
Expand Down Expand Up @@ -46,14 +46,17 @@ themeFiles.forEach((file) => {

const themeCss = compileString(themeContent, {
loadPaths: [styleDir],
style: 'compressed',
}).css

const lightThemeCss = compileString(lightThemeContent, {
loadPaths: [styleDir],
style: 'compressed',
}).css

const darkThemeCss = compileString(darkThemeContent, {
loadPaths: [styleDir],
style: 'compressed',
}).css

fs.writeFileSync(path.resolve(outputDir, `${filename}.css`), themeCss)
Expand Down
2 changes: 1 addition & 1 deletion plugins/markdown/plugin-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@shikijs/transformers": "^1.17.7",
Expand Down
2 changes: 1 addition & 1 deletion plugins/pwa/plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion plugins/search/plugin-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"copy": "cpx \"src/**/*.{d.ts,svg}\" lib",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"chokidar": "^3.6.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/tools/plugin-redirect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vuepress/helper": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"dependencies": {
"@vue/shared": "^3.5.6",
Expand Down
2 changes: 1 addition & 1 deletion tools/highlighter-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"style": "sass src:lib --no-source-map"
"style": "sass src:lib --embed-sources --style=compressed"
},
"peerDependencies": {
"@vueuse/core": "^11.0.0",
Expand Down

0 comments on commit 71c620c

Please sign in to comment.