Skip to content

Commit

Permalink
Merge pull request #121 from vordgi/ncm-120
Browse files Browse the repository at this point in the history
ncm-120 update classnames-minifier
  • Loading branch information
vordgi authored Oct 26, 2024
2 parents 5fec1e0 + 9c6cd55 commit 627921b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"css-loader": ">=4.0.0"
},
"dependencies": {
"classnames-minifier": "0.2.2",
"classnames-minifier": "1.0.0",
"uuid": "10.0.0"
}
}
11 changes: 8 additions & 3 deletions package/src/withClassnamesMinifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import type { Configuration } from "webpack";
import type { Config } from "classnames-minifier/dist/lib/types/plugin";
import ClassnamesMinifier from "classnames-minifier";
import injectConfig from "./lib/injectConfig";
import path from "path";
import fs from "fs";

import injectConfig from "./lib/injectConfig";

type PluginOptions = Omit<Config, "cacheDir" | "distDir"> & { disabled?: boolean };
type PluginOptions = Omit<Config, "cacheDir" | "distDir" | "checkDistFreshness"> & { disabled?: boolean };

let classnamesMinifier: ClassnamesMinifier;

Expand All @@ -20,9 +22,12 @@ const withClassnameMinifier = (pluginOptions: PluginOptions = {}) => {
classnamesMinifier = new ClassnamesMinifier({
prefix: pluginOptions.prefix,
reservedNames: pluginOptions.reservedNames,
disableDistDeletion: pluginOptions.disableDistDeletion,
distDeletionPolicy: pluginOptions.distDeletionPolicy,
experimental: pluginOptions.experimental,
distDir: distDirAbsolute,
checkDistFreshness: () => {
return !fs.existsSync(".next/build-manifest.json");
},
cacheDir,
});
}
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit 627921b

Please sign in to comment.