Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit 6ae0943

Browse files
committed
feat(test): Update CSS module preprocessor config
This commit updates the CSS module naming pattern in the compiler tests. The new pattern is '[local]_[name]-css-module-test'. The option 'includeOriginalPath' is also set to false. Changes are also reflected in the Output.svelte file.
1 parent c472ce7 commit 6ae0943

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tests/class/Output.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script>
22
const s = {
3-
error: 's-Lwza_error',
4-
success: 's-Lwza_success',
5-
};
3+
error: "error_class-module-css-module-test",
4+
success: "success_class-module-css-module-test"
5+
};
66
</script>
77

88
<div class={s.error}>
@@ -15,12 +15,12 @@
1515

1616
<style>
1717
18-
/* /Users/ryoppippi/ghq/github.com/ryoppippi/svelte-preprocess-css-modules/tests/assets/class.module.css */
19-
.s-Lwza_error {
18+
19+
.error_class-module-css-module-test {
2020
color: red;
2121
}
2222
23-
.s-Lwza_success {
23+
.success_class-module-css-module-test {
2424
color: green;
2525
}
2626

tests/compiler.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ export async function compiler({
1212
}: Params) {
1313
const { code } = await preprocess(
1414
source,
15-
[cssModules()],
15+
[cssModules({
16+
moduleNameingPattern: '[local]_[name]-css-module-test',
17+
includeOriginalPath: false,
18+
})],
1619
preprocessOptions,
1720
);
1821

0 commit comments

Comments
 (0)