Skip to content

Commit

Permalink
fix(lsloader): Fix that does not generate hex when missing .js and .c…
Browse files Browse the repository at this point in the history
…ss suffixes

Merge pull request #315 from EYHN/canary
  • Loading branch information
iblh committed Apr 24, 2017
2 parents ecfb056 + 1a5dec2 commit e69092b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions scripts/lib/css_lsload.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ function cssHelper() {

if (i) result += '\n';

var localpath = path_for.call(this,path);

if (Array.isArray(path)) {
result += jsHelper.apply(this, path);
} else {
if (path.indexOf('?') < 0 && path.substring(path.length - 4, path.length) !== '.css') path += '.css';
var localpath = path_for.call(this,path);
result += '<style id="' + path + '"></style><script>if(typeof window.lsLoadCSSMaxNums === "undefined")window.lsLoadCSSMaxNums = 0;' +
'window.lsLoadCSSMaxNums++;' +
'lsloader.load("' + path + '","' +
Expand Down
3 changes: 1 addition & 2 deletions scripts/lib/js_lsload.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ function jsHelper() {

if (i) result += '\n';

var localpath = path_for.call(this,path);

if (Array.isArray(path)) {
result += jsHelper.apply(this, path);
} else {
if (path.indexOf('?') < 0 && path.substring(path.length - 3, path.length) !== '.js') path += '.js';
var localpath = path_for.call(this,path);
result += '<script>lsloader.load("' + path + '","' +
require("../../../../node_modules/hexo/lib/plugins/helper/url_for").call(this,path) +
(fs.existsSync(localpath)?'?' + get_file_hex(localpath):'') + '")</script>'
Expand Down

0 comments on commit e69092b

Please sign in to comment.