From ecf1c092acaa494d797e167aa2f0d53886fe2443 Mon Sep 17 00:00:00 2001 From: Nik Butenko Date: Mon, 3 Dec 2018 18:00:31 +1100 Subject: [PATCH] Support for @scoped modules Lib names can be in `@somescope/lib-name` format and `^\w` regex does not cover it --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6cc6c48..eba1c01 100644 --- a/src/index.js +++ b/src/index.js @@ -53,7 +53,7 @@ export default function transformCssModules({ types: t }) { let filePathOrModuleName = cssFile; // only resolve path to file when we have a file path - if (!/^\w/i.test(filePathOrModuleName)) { + if (!/^\w|^@/i.test(filePathOrModuleName)) { const from = resolveModulePath(filepath); filePathOrModuleName = resolve(from, filePathOrModuleName); }