@nimpl/classnames-minifier 3.2.1 → 4.0.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import type { ModuleOptions } from "webpack";
2
2
  import type ClassnamesMinifier from "classnames-minifier";
3
- export declare type InjectConfig = {
3
+ export type InjectConfig = {
4
4
  localIdentName?: string;
5
5
  classnamesMinifier: ClassnamesMinifier;
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import type { Config } from "classnames-minifier/dist/lib/types/plugin";
2
- declare type PluginOptions = Omit<Config, "cacheDir" | "distDir"> & {
2
+ type PluginOptions = Omit<Config, "cacheDir" | "distDir" | "checkDistFreshness"> & {
3
3
  disabled?: boolean;
4
4
  };
5
5
  declare const withClassnameMinifier: (pluginOptions?: PluginOptions) => (nextConfig?: any) => any;
@@ -4,8 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const classnames_minifier_1 = __importDefault(require("classnames-minifier"));
7
- const injectConfig_1 = __importDefault(require("./lib/injectConfig"));
8
7
  const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const injectConfig_1 = __importDefault(require("./lib/injectConfig"));
9
10
  let classnamesMinifier;
10
11
  const withClassnameMinifier = (pluginOptions = {}) => {
11
12
  return (nextConfig = {}) => {
@@ -18,9 +19,12 @@ const withClassnameMinifier = (pluginOptions = {}) => {
18
19
  classnamesMinifier = new classnames_minifier_1.default({
19
20
  prefix: pluginOptions.prefix,
20
21
  reservedNames: pluginOptions.reservedNames,
21
- disableDistDeletion: pluginOptions.disableDistDeletion,
22
+ distDeletionPolicy: pluginOptions.distDeletionPolicy,
22
23
  experimental: pluginOptions.experimental,
23
24
  distDir: distDirAbsolute,
25
+ checkDistFreshness: () => {
26
+ return !fs_1.default.existsSync(".next/build-manifest.json");
27
+ },
24
28
  cacheDir,
25
29
  });
26
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimpl/classnames-minifier",
3
- "version": "3.2.1",
3
+ "version": "4.0.0-canary.1",
4
4
  "description": "Library for configuring style modules to generate compressed classes",
5
5
  "main": "dist/withClassnamesMinifier.js",
6
6
  "types": "dist/withClassnamesMinifier.d.ts",
@@ -8,11 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "scripts": {
11
- "build": "tsc",
12
- "nimpl:classnames-minifier": "pnpm --filter @nimpl/classnames-minifier",
13
- "lint": "eslint .",
14
- "eslint": "eslint",
15
- "prepare": "husky"
11
+ "build": "tsc"
16
12
  },
17
13
  "keywords": [
18
14
  "next",
@@ -38,23 +34,17 @@
38
34
  },
39
35
  "license": "MIT",
40
36
  "devDependencies": {
41
- "@types/node": "16.11.12",
42
- "@types/uuid": "9.0.7",
43
- "@types/webpack": "5.28.0",
44
- "css-loader": "6.9.0",
45
- "typescript": "4.5.4",
46
- "eslint": "8.57.0",
47
- "eslint-config-prettier": "^9.1.0",
48
- "eslint-plugin-prettier": "^5.1.3",
49
- "husky": "^9.0.11",
50
- "prettier": "^3.2.5",
51
- "typescript-eslint": "^7.6.0"
37
+ "@types/node": "22.8.1",
38
+ "@types/uuid": "10.0.0",
39
+ "@types/webpack": "5.28.5",
40
+ "css-loader": "7.1.2",
41
+ "typescript": "5.6.3"
52
42
  },
53
43
  "peerDependencies": {
54
44
  "css-loader": ">=4.0.0"
55
45
  },
56
46
  "dependencies": {
57
- "classnames-minifier": "0.2.2",
58
- "uuid": "9.0.1"
47
+ "classnames-minifier": "1.0.0",
48
+ "uuid": "10.0.0"
59
49
  }
60
- }
50
+ }