Skip to content

Commit 44238ec

Browse files
committed
add base directory path to loaded files after index html loaded
1 parent ebd6615 commit 44238ec

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/load.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ var Loader = function (data) {
256256

257257
while(urlMatch = regexp.exec(textOrigin)) {
258258
url = urlMatch[2];
259-
logger.log(urlMatch[0]);
260259

261260
if (url && !utils.isEmbeddedSource(url)) {
262261
var urlAbsolutePath = utils.getAbsolutePath(cssRemotePath, url);
@@ -293,6 +292,8 @@ var Loader = function (data) {
293292
return prepare(html)
294293
})
295294
.then(function (html) { // Load css sources in index page
295+
fs.ensureDirSync(options.path);
296+
setLoadedFilename(options.url, options.path);
296297
return loadCssSources(html, options.url);
297298
})
298299
}

lib/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ function trimFilename(filename) {
1313
hashIndex = filename.indexOf('#'),
1414
indexToCut = filename.length;
1515

16-
if (questionMarkIndex > 0 && hashIndex > 0) {
16+
if (questionMarkIndex >= 0 && hashIndex >= 0) {
1717
indexToCut = questionMarkIndex < hashIndex ? questionMarkIndex : hashIndex
18-
} else if (questionMarkIndex > 0) {
18+
} else if (questionMarkIndex >= 0) {
1919
indexToCut = questionMarkIndex;
20-
} else if (hashIndex > 0) {
20+
} else if (hashIndex >= 0) {
2121
indexToCut = hashIndex;
2222
}
2323

0 commit comments

Comments
 (0)