mirror of
https://github.com/IT4Change/IT4C.dev.git
synced 2025-12-13 09:25:49 +00:00
feat(other): command dev-prod (#260)
* compress images using `vuepress-plugin-imagemin compress all images using imagemin plugin * updated vuepress-plugin-imagemin to 0.1.2 * command: dev-prod adds a new command `npm run dev-prod` which build the project and then spins up a http server. This was implemented to be able to test certain scenarious like image compression.
This commit is contained in:
parent
aaa5c48cf4
commit
d77479beda
@ -1,4 +1,5 @@
|
||||
import { viteBundler } from '@vuepress/bundler-vite'
|
||||
import Imagemin from 'vuepress-plugin-imagemin'
|
||||
import { defineUserConfig } from 'vuepress'
|
||||
import meta from './config/meta'
|
||||
import theme from './config/theme'
|
||||
@ -8,4 +9,34 @@ export default defineUserConfig({
|
||||
...meta,
|
||||
theme,
|
||||
bundler: viteBundler({}),
|
||||
plugins: [
|
||||
Imagemin({
|
||||
gifsicle: {
|
||||
optimizationLevel: 7,
|
||||
interlaced: false,
|
||||
},
|
||||
optipng: {
|
||||
optimizationLevel: 7,
|
||||
},
|
||||
mozjpeg: {
|
||||
quality: 20,
|
||||
},
|
||||
pngquant: {
|
||||
quality: [0.8, 0.9],
|
||||
speed: 4,
|
||||
},
|
||||
svgo: {
|
||||
plugins: [
|
||||
{
|
||||
name: 'removeViewBox',
|
||||
},
|
||||
{
|
||||
name: 'removeEmptyAttrs',
|
||||
active: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
})
|
||||
|
||||
4750
package-lock.json
generated
4750
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,7 @@
|
||||
"scripts": {
|
||||
"build": "vuepress build docs",
|
||||
"dev": "vuepress dev docs",
|
||||
"dev-prod": "npm run build && http-server ./docs/.vuepress/dist",
|
||||
"test": "textlint \"*.md\" \"docs/**/*.md\""
|
||||
},
|
||||
"repository": {
|
||||
@ -22,6 +23,7 @@
|
||||
"@textlint-rule/textlint-rule-no-unmatched-pair": "^2.0.4",
|
||||
"@vuepress/bundler-vite": "^2.0.0-rc.20",
|
||||
"@vuepress/plugin-slimsearch": "^2.0.0-rc.82",
|
||||
"http-server": "^14.1.1",
|
||||
"textlint": "^14.4.2",
|
||||
"textlint-filter-rule-comments": "^1.2.2",
|
||||
"textlint-rule-apostrophe": "^3.0.0",
|
||||
@ -37,6 +39,7 @@
|
||||
"textlint-rule-period-in-list-item": "^1.0.1",
|
||||
"textlint-rule-write-good": "^2.0.0",
|
||||
"vuepress": "^2.0.0-rc.20",
|
||||
"vuepress-plugin-imagemin": "^0.1.2",
|
||||
"vuepress-theme-hope": "^2.0.0-rc.74"
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user