From ff4d4a90b0b7d947c8ef0bf8ec5204d353b162a6 Mon Sep 17 00:00:00 2001 From: Marton Lederer Date: Sat, 20 Feb 2021 15:31:10 +0100 Subject: [PATCH] feat: use absolute path for resolving temporary css files --- src/index.ts | 7 +++---- test/styles/test/components/Wallet.module.sass | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 test/styles/test/components/Wallet.module.sass diff --git a/src/index.ts b/src/index.ts index ccad1de..77d8145 100644 --- a/src/index.ts +++ b/src/index.ts @@ -133,10 +133,9 @@ const postCSSPlugin = ({ return { resolveDir, - contents: `import "${args.path.replace( - resolveDir, - "." - )}"; export default ${JSON.stringify(mod.map)};` + contents: `import "${args.path}";\nexport default ${JSON.stringify( + mod && mod.map ? mod.map : {} + )};` }; } ); diff --git a/test/styles/test/components/Wallet.module.sass b/test/styles/test/components/Wallet.module.sass new file mode 100644 index 0000000..a6fd6ac --- /dev/null +++ b/test/styles/test/components/Wallet.module.sass @@ -0,0 +1,4 @@ +.Wallet + text-align: left + justify-content: space-around + font-size: 2em \ No newline at end of file