Skip to content

Commit

Permalink
Handle relative paths properly, when @importing.
Browse files Browse the repository at this point in the history
  • Loading branch information
danfuzz committed Sep 9, 2016
1 parent d7940cf commit 0a9d025
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/node/utils/Minify.js
Expand Up @@ -409,7 +409,8 @@ function compressJS(content)
function compressCSS(filename, content, callback)
{
try {
new CleanCSS({relativeTo: ROOT_DIR}).minify(content, function (errors, minified) {
var base = path.join(ROOT_DIR, path.dirname(filename));
new CleanCSS({relativeTo: base}).minify(content, function (errors, minified) {
if (errors) {
// On error, just yield the un-minified original.
callback(null, content);
Expand Down
2 changes: 1 addition & 1 deletion src/static/css/iframe_editor.css
Expand Up @@ -2,7 +2,7 @@
Also see inner.css, included only in the inner one.
*/

@import url('css/lists_and_indents.css');
@import url('./lists_and_indents.css');

html { cursor: text; } /* in Safari, produces text cursor for whole doc (inc. below body) */
span { cursor: auto; }
Expand Down
2 changes: 1 addition & 1 deletion src/static/css/timeslider.css
@@ -1,4 +1,4 @@
@import url('css/lists_and_indents.css');
@import url('./lists_and_indents.css');

p.pblort {
height: 100px;
Expand Down

0 comments on commit 0a9d025

Please sign in to comment.