diff --git a/README.md b/README.md index 7fe27e1..a747b48 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ Visit the [npm](https://www.npmjs.com/package/next-css-obfuscator) page. ##### Obfuscate all files ```javascript + /** @type {import("next-css-obfuscator").Options} */ module.exports = { enable: true, mode: "random", // random | simplify @@ -181,10 +182,11 @@ Visit the [npm](https://www.npmjs.com/package/next-css-obfuscator) page. ##### Partially obfuscate - > [!CAUTION]\ - > Partially obfuscate can be EXTREMELY buggy. Be cautious when using this feature. +> [!CAUTION]\ +> Partially obfuscate can be EXTREMELY buggy. Be cautious when using this feature. ```javascript + /** @type {import("next-css-obfuscator").Options} */ module.exports = { enable: true, mode: "random", // random | simplify @@ -196,20 +198,10 @@ Visit the [npm](https://www.npmjs.com/package/next-css-obfuscator) page. ``` - ##### TypeScript - - ```ts - import { Options } from "next-css-obfuscator"; - - module.exports = { - // other options ... - } satisfies Options; - ``` - Feel free to checkout [📖 Config Options Reference](#-config-options-reference) for more options and details. - > [!TIP]\ - > The obfuscation will never work as expected, tweak the options with your own needs. +> [!TIP]\ +> The obfuscation will never work as expected, tweak the options with your own needs. 2. Add the following code to `package.json`: @@ -286,6 +278,7 @@ If you are interested in my setting, here it is ```javascript // next-css-obfuscator.config.cjs +/** @type {import("next-css-obfuscator").Options} */ module.exports = { enable: true, mode: "random", // random | simplify diff --git a/package.json b/package.json index ca340e3..05aae5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "next-css-obfuscator", - "version": "3.0.0-beta.4", + "version": "3.0.0-beta.5", "description": "A package deeply inspired by PostCSS-Obfuscator but for Next.js.", "main": "dist/index.js", "type": "commonjs", diff --git a/src/utils.ts b/src/utils.ts index 229bd13..84e6bfd 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -607,11 +607,11 @@ export const loadConversionTables = (folderPath: string): ConversionTables => { const fileData = JSON.parse(fs.readFileSync(filePath, "utf-8")); if ( - Object.keys(fileData).includes("ident") && - Object.keys(fileData).includes("selector") + Object.keys(fileData).includes("idents") && + Object.keys(fileData).includes("selectors") ) { - Object.assign(tables.idents, fileData.ident); - Object.assign(tables.selectors, fileData.selector); + Object.assign(tables.idents, fileData.idents); + Object.assign(tables.selectors, fileData.selectors); } else { // if the file doesn't have ident, it should be selector //? For backward compatibility