Skip to content

Commit baaab3c

Browse files
committed
The $scipt.path('/modules/') was not working for .js files
You only applied scriptpath if the file didn't include '.js'. I think it should work for .js files as well. In the change I removed the condition of indexOf('.js')===-1, and added a part where I add '.js' if the file doesn't end with .js.
1 parent b29a095 commit baaab3c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/script.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848
setTimeout(function () {
4949
each(paths, function loading(path, force) {
5050
if (path === null) return callback()
51-
path = !force && path.indexOf('.js') === -1 && !/^https?:\/\//.test(path) && scriptpath ? scriptpath + path + '.js' : path
51+
52+
if (!force && !/^https?:\/\//.test(path) && scriptpath) {
53+
path = (path.indexOf('.js') === -1) ? scriptpath + path + '.js' : scriptpath + path;
54+
}
55+
5256
if (scripts[path]) {
5357
if (id) ids[id] = 1
5458
return (scripts[path] == 2) ? callback() : setTimeout(function () { loading(path, true) }, 0)

0 commit comments

Comments
 (0)