Skip to content

Commit c2df9e4

Browse files
committed
- fix bug: will try using fs once defined even in browser.
- bump version
1 parent 11459ad commit c2df9e4

10 files changed

Lines changed: 17 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Logs
22

3+
## v5.0.2
4+
5+
- fix bug: will try using `fs` once defined even in browser.
6+
7+
38
## v5.0.1
49

510
- fix bug: `_ref` pollutes the input bid.

build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "build src -> .built .."
1212
cat .built/head.js > dist/node.js
1313
cat .built/index.js >> dist/node.js
1414
cat .built/bundle.js >> dist/node.js
15+
echo "csp.__node = true;" >> dist/node.js
1516
cat .built/foot.js >> dist/node.js
1617

1718
echo "(function(){" > dist/index.js

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ isScope = function(it){
44
return /^:scope[ .:\[#]|^:scope$/.exec(it);
55
};
66
_fetch = function(u, c){
7-
if ((typeof fs != 'undefined' && fs !== null) && !/^https:/.exec(u)) {
7+
if (csp.__node && (typeof fs != 'undefined' && fs !== null) && !/^https:/.exec(u)) {
88
return new Promise(function(res, rej){
99
return fs.readFile(u, function(e, b){
1010
if (e) {

dist/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ isScope = function(it){
44
return /^:scope[ .:\[#]|^:scope$/.exec(it);
55
};
66
_fetch = function(u, c){
7-
if ((typeof fs != 'undefined' && fs !== null) && !/^https:/.exec(u)) {
7+
if (csp.__node && (typeof fs != 'undefined' && fs !== null) && !/^https:/.exec(u)) {
88
return new Promise(function(res, rej){
99
return fs.readFile(u, function(e, b){
1010
if (e) {

0 commit comments

Comments
 (0)