Skip to content

Commit

Permalink
Actually use cssnano
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Jan 4, 2024
1 parent 926b89d commit cd0c6be
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 536 deletions.
11 changes: 7 additions & 4 deletions frontend/utils.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import autoprefixer from 'autoprefixer'
import chokidar from 'chokidar'
import cors from 'cors'
import cssnano from 'cssnano'
import { analyzeMetafile, context } from 'esbuild'
import { lessLoader } from 'esbuild-plugin-less'
import { sassPlugin } from 'esbuild-sass-plugin'
Expand Down Expand Up @@ -129,10 +130,12 @@ export const commonConfig = {
plugins: [
sassPlugin({
async transform(source, resolveDir, filePath) {
const { css } = await postcss([tailwindcss, autoprefixer, postcssPresetEnv({ stage: 0 })]).process(
source,
{ from: filePath }
)
const { css } = await postcss([
tailwindcss,
autoprefixer,
postcssPresetEnv({ stage: 0 }),
cssnano({ preset: 'default' }),
]).process(source, { from: filePath })
return css
},
}),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"clsx": "^1.1.1",
"core-js": "^3.32.0",
"cors": "^2.8.5",
"cssnano": "^4.1.10",
"cssnano": "^6.0.3",
"d3": "^7.8.2",
"d3-sankey": "^0.12.3",
"dayjs": "^1.10.7",
Expand Down
Loading

0 comments on commit cd0c6be

Please sign in to comment.