Skip to content

Commit 4df2868

Browse files
committed
2.7.1
1 parent 6c26f3a commit 4df2868

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## V2.7.1
2+
- support esbuild@^0.17
3+
14
## V2.7.0
25
- fix inject logic to avoid styles missing in some micro-frontend framework
36
- ***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.

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ declare interface PluginOptions {
7070
version?: string;
7171
};
7272
usePascalCase?: boolean;
73+
/** since [email protected] has removed the `watch` option, you have to set it here explicitly */
74+
watch?: boolean;
7375
}
7476

7577
declare interface BuildContext {

lib/plugin.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,7 @@ const onResolveModulesCss = async (args, build) => {
189189
pluginName
190190
};
191191

192-
if (initialOptions.watch) {
193-
log('watching', rpath);
194-
result.watchFiles = [absPath];
195-
}
192+
result.watchFiles = [absPath];
196193

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

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

217-
const useCache = build.initialOptions.watch;
214+
const useCache = build.initialOptions.watch ?? options.watch ?? false;
218215

219216
useCache && log(`checking cache for`, rpath);
220217
const cached = useCache && (await cache.get(absPath));

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-css-modules-plugin",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",
55
"main": "./index.js",
66
"types": "./index.d.ts",
@@ -11,7 +11,7 @@
1111
"css modules"
1212
],
1313
"engines": {
14-
"node": ">= 14"
14+
"node": ">= 16"
1515
},
1616
"author": "[email protected]",
1717
"license": "MIT",
@@ -22,16 +22,16 @@
2222
},
2323
"devDependencies": {
2424
"@types/node": "^17.0.23",
25-
"esbuild": "^0.16.2"
25+
"esbuild": "^0.17.3"
2626
},
2727
"peerDependencies": {
2828
"esbuild": "*"
2929
},
3030
"dependencies": {
31-
"lightningcss": "^1.17.1",
31+
"lightningcss": "^1.18.0",
3232
"fs-extra": "^10.1.0",
3333
"lodash": "^4.17.21",
34-
"postcss": "^8.4.19",
34+
"postcss": "^8.4.21",
3535
"postcss-modules": "^6.0.0",
3636
"tmp": "^0.2.1"
3737
},

0 commit comments

Comments
 (0)