Skip to content

Commit 50273ba

Browse files
committed
feat: improve autoModules
1 parent cefb4fa commit 50273ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function thunder(input: Options = {}): Plugin {
6464
if (!filter(id)) return null;
6565
const options = {
6666
...opts,
67-
cssModules: opts.cssModules || (input.autoModules && modulesFilter(id)),
67+
cssModules: opts.cssModules ?? (input.autoModules && modulesFilter(id)),
6868
filename: id,
6969
resolver: {
7070
resolve: (specifier: string, from: string) =>
@@ -77,7 +77,7 @@ export default function thunder(input: Options = {}): Plugin {
7777
const map = "map" in res ? res.map?.toString() : undefined;
7878
let code = `export default ${JSON.stringify(res.code.toString())};`;
7979

80-
if ("cssModules" in options) {
80+
if (options.cssModules) {
8181
code += Object.entries(res.exports ?? {})
8282
.map(
8383
([key, exp]) =>

0 commit comments

Comments
 (0)