Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Prevent TypeError on <style> tags #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

// loop on document stylesheets to check if media is loaded
while (i--) {
if (sheets[i].href.indexOf(href) != -1) {
if (sheets[i].href && sheets[i].href.indexOf(href) != -1) {
elem.setAttribute('data-loaded', true);
self.onModuleLoaded(elem.getAttribute('data-module'), elem.getAttribute('data-count'));
return;
Expand Down
27 changes: 27 additions & 0 deletions minify.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compress": {
"sequences": true,
"properties": true,
"dead_code": true,
"drop_debugger": true,
"conditionals": true,
"comparisons": true,
"evaluate": true,
"booleans": true,
"loops": true,
"unused": true,
"hoist_funs": true,
"if_return": true,
"join_vars": true,
"cascade": true,
"warnings": true,
"negate_iife": true,
"unsafe": false,
"hoist_vars": false,
"pure_getters": false,
"drop_console": false,
"keep_fargs": false,
"toplevel": false
},
"mangle": {}
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "include.js",
"version": "3.0.3",
"version": "3.0.5",
"description": "**Include.js** is a tiny Javascript loader. It can load normal javascript files but is more efficient with **web modules**.",
"main": "include-min.js",
"dependencies": {},
Expand All @@ -14,10 +14,12 @@
"karma-jasmine": "^1.0.2",
"karma-opera-launcher": "^1.0.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-safari-launcher": "^1.0.0"
"karma-safari-launcher": "^1.0.0",
"uglify-es": "^3.1.2"
},
"scripts": {
"test": "karma start test/karma.conf.js --single-run"
"test": "karma start test/karma.conf.js --single-run",
"compress": "uglifyjs include.js --config-file minify.json -o include-min.js"
},
"repository": {
"type": "git",
Expand Down
Loading