File tree Expand file tree Collapse file tree 6 files changed +764
-27
lines changed Expand file tree Collapse file tree 6 files changed +764
-27
lines changed Original file line number Diff line number Diff line change 2828 " frontmatter" ,
2929 " globby" ,
3030 " gtag" ,
31+ " lightningcss" ,
3132 " mdit" ,
3233 " nprogress" ,
3334 " prefetch" ,
Original file line number Diff line number Diff line change 1+ Check if the ` @container ` rule could be supported and minimized correctly.
2+
3+ <div class =" container " >
4+
5+ Container text
6+
7+ </div >
8+
9+ <style >
10+ .container {
11+ container-type : inline-size;
12+ }
13+ .container p {
14+ font-size : clamp (.75rem , calc (100 cqw / 40 ), 2rem );
15+ text-align : left ;
16+ }
17+ @container (max-width: 480px) {
18+ .container p {
19+ text-align : center ;
20+ font-weight : bold ;
21+ }
22+ }
23+ </style >
Original file line number Diff line number Diff line change 4646 "chokidar" : " ^3.6.0" ,
4747 "copy-webpack-plugin" : " ^12.0.2" ,
4848 "css-loader" : " ^7.1.1" ,
49+ "css-minimizer-webpack-plugin" : " ^7.0.0" ,
4950 "esbuild-loader" : " ~4.1.0" ,
5051 "express" : " ^4.19.2" ,
5152 "html-webpack-plugin" : " ^5.6.0" ,
53+ "lightningcss" : " ^1.24.1" ,
5254 "mini-css-extract-plugin" : " ^2.9.0" ,
5355 "postcss" : " ^8.4.38" ,
54- "postcss-csso" : " ^6.0.1" ,
5556 "postcss-loader" : " ^8.1.1" ,
5657 "style-loader" : " ^4.0.0" ,
5758 "vue" : " ^3.4.27" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { createRequire } from 'node:module'
22import type { App } from '@vuepress/core'
33import { fs } from '@vuepress/utils'
44import CopyWebpackPlugin from 'copy-webpack-plugin'
5+ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'
56import MiniCssExtractPlugin from 'mini-css-extract-plugin'
67import type Config from 'webpack-chain'
78import { createClientBaseConfig } from '../config/index.js'
@@ -83,6 +84,16 @@ export const createClientConfig = async (
8384 // enable runtimeChunk
8485 config . optimization . runtimeChunk ( true )
8586
87+ // minify css
88+ config . optimization
89+ . minimizer ( 'css-minimizer-webpack-plugin' )
90+ . use ( CssMinimizerPlugin , [
91+ {
92+ minify :
93+ CssMinimizerPlugin . lightningCssMinify as CssMinimizerPlugin . BasicMinimizerImplementation < unknown > ,
94+ } ,
95+ ] )
96+
8697 // disable performance hints
8798 if ( ! app . env . isDebug ) {
8899 config . performance . hints ( false )
Original file line number Diff line number Diff line change 11import { createRequire } from 'node:module'
22import autoprefixer from 'autoprefixer'
33import MiniCssExtractPlugin from 'mini-css-extract-plugin'
4- import postcssCsso from 'postcss-csso'
54import type Config from 'webpack-chain'
65import type {
76 LessLoaderOptions ,
@@ -69,7 +68,7 @@ export const handleModuleStyles = ({
6968 . loader ( require . resolve ( 'postcss-loader' ) )
7069 . options ( {
7170 postcssOptions : {
72- plugins : [ autoprefixer , postcssCsso ] ,
71+ plugins : [ autoprefixer ] ,
7372 } ,
7473 ...options . postcss ,
7574 } )
You can’t perform that action at this time.
0 commit comments