Skip to content

Commit

Permalink
2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
indooorsman committed Jan 19, 2023
1 parent 6c26f3a commit 4df2868
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## V2.7.1
- support esbuild@^0.17

## V2.7.0
- fix inject logic to avoid styles missing in some micro-frontend framework
- ***Important***: there's a breaking change of inject logic, before this version the inject method would be deleted once it's called, from this verson it will ***not*** be deleted anymore, for people using custom inject method please pay attention.
Expand Down
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ declare interface PluginOptions {
version?: string;
};
usePascalCase?: boolean;
/** since [email protected] has removed the `watch` option, you have to set it here explicitly */
watch?: boolean;
}

declare interface BuildContext {
Expand Down
7 changes: 2 additions & 5 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ const onResolveModulesCss = async (args, build) => {
pluginName
};

if (initialOptions.watch) {
log('watching', rpath);
result.watchFiles = [absPath];
}
result.watchFiles = [absPath];

return result;
};
Expand All @@ -214,7 +211,7 @@ const onLoadModulesCss = async (build, options, args) => {

log(`loading ${rpath}${args.suffix}`);

const useCache = build.initialOptions.watch;
const useCache = build.initialOptions.watch ?? options.watch ?? false;

useCache && log(`checking cache for`, rpath);
const cached = useCache && (await cache.get(absPath));
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esbuild-css-modules-plugin",
"version": "2.7.0",
"version": "2.7.1",
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",
"main": "./index.js",
"types": "./index.d.ts",
Expand All @@ -11,7 +11,7 @@
"css modules"
],
"engines": {
"node": ">= 14"
"node": ">= 16"
},
"author": "[email protected]",
"license": "MIT",
Expand All @@ -22,16 +22,16 @@
},
"devDependencies": {
"@types/node": "^17.0.23",
"esbuild": "^0.16.2"
"esbuild": "^0.17.3"
},
"peerDependencies": {
"esbuild": "*"
},
"dependencies": {
"lightningcss": "^1.17.1",
"lightningcss": "^1.18.0",
"fs-extra": "^10.1.0",
"lodash": "^4.17.21",
"postcss": "^8.4.19",
"postcss": "^8.4.21",
"postcss-modules": "^6.0.0",
"tmp": "^0.2.1"
},
Expand Down

0 comments on commit 4df2868

Please sign in to comment.