Skip to content

Commit 162c0be

Browse files
committed
feat(css-to-js): abs vs rel imports
1 parent 18e07f8 commit 162c0be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/css-to-js/css-to-js.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ exports.transform = (file, processor, opts = {}) => {
164164
if(!imports.size) {
165165
return;
166166
}
167+
168+
const source = options.relativeImports ? `./${path.relative(path.dirname(file), from)}` : from;
167169

168170
const names = [ ...imports ].map(([ key, value ]) => esm(key, value));
169171

170-
out.push(`import { ${names.join(", ")} } from "${slash(from)}";`);
172+
out.push(`import { ${names.join(", ")} } from "${slash(source)}";`);
171173
});
172174

173175
// Add the rest of the exported keys in whatever order because it doesn't matter

0 commit comments

Comments
 (0)