Skip to content

Commit

Permalink
fix: less support none-root css imports and urls
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jan 5, 2024
1 parent d3c8cfe commit ccfdde7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
12 changes: 12 additions & 0 deletions e2e/fixtures/less.normal/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ assert(
),
"should not panic when parsing grid-template"
);
assert(
files["index.css"].includes(
`.foo {`
),
"should support none-root css imports"
);
assert(
files["index.css"].includes(
`background: url(data:image/png;base64,`
),
"should support none-root urls"
);
2 changes: 1 addition & 1 deletion e2e/fixtures/less.normal/src/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "theme.less";
@import "theme/theme.less";
@import "failed-when-math-is-on.less";
.container {
padding-top: 80px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.theme {
.foo {
color: red;
}
6 changes: 6 additions & 0 deletions e2e/fixtures/less.normal/src/theme/theme.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import "./foo.css";

.theme {
color: red;
background: url(umi.png);
}
Binary file added e2e/fixtures/less.normal/src/theme/umi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/bundler-okam/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const onCompileLess = async function (opts, filePath) {
plugins: [resolvePlugin],
modifyVars,
sourceMap,
relativeUrls: true,
});
return result.css;
};
Expand Down

0 comments on commit ccfdde7

Please sign in to comment.