Skip to content

Commit c041858

Browse files
committed
actualize rootRelativePath too
1 parent 03a680d commit c041858

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

src/file-system-loader.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export default class FileSystemLoader {
4242
if (newPath[0] !== '.' && newPath[0] !== '/') {
4343
try {
4444
fileRelativePath = nodeResolve.sync(newPath, { basedir: rootRelativeDir });
45+
// in this case we need to actualize rootRelativePath too
46+
rootRelativePath = path.relative(this.root, fileRelativePath);
4547
}
4648
catch (e) {}
4749
}

test/test-cases/compose-local-node-module/expected.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
._compose_local_node_module_cool_local_styles_foo__example {
1+
._compose_local_node_module_node_modules_cool_local_styles_foo__example {
22
color: #F00;
33
}
44
._compose_local_node_module_source__foo {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"foo": "_compose_local_node_module_source__foo _compose_local_node_module_cool_local_styles_foo__example"
2+
"foo": "_compose_local_node_module_source__foo _compose_local_node_module_node_modules_cool_local_styles_foo__example"
33
}

test/test-cases/compose-node-module/expected.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
._compose_node_module_cool_styles_foo__example {
1+
._node_modules_cool_styles_foo__example {
22
color: #F00;
33
}
44
._compose_node_module_source__foo {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"foo": "_compose_node_module_source__foo _compose_node_module_cool_styles_foo__example"
2+
"foo": "_compose_node_module_source__foo _node_modules_cool_styles_foo__example"
33
}

0 commit comments

Comments
 (0)