You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using hashwords in an Aurelia project, with JSPM and SystemJS. During development mode, it works great. But when bundling, having some issues:
First is error "hashwords is not defined". This is caused by this line in index.js:
hashwords=require('./lib/hashwords');
Changing it to this fixes the problem:
varhashwords=require('./lib/hashwords');
However, that leads to the second problem: "md5 is not a function", in hashwords.js, function tokensFromString:
hash+=md5(hash);
This is because in bundled mode, this line in hashwords.js returns undefined:
md5=require('./md5').md5;
Just as an experiment, I modified lib/md5.js, removed the IIFE wrapping it, and instead of the define check, replaced with node style module.exports, and that solved the problem:
module.exports={md5: md5};
Does anyone know how to make this library work within a SystemJS bundle without modifying the code? Otherwise I could submit a PR with my fixes, except I'm not sure if this would break other usages such as via bower install.
The text was updated successfully, but these errors were encountered:
I'm using hashwords in an Aurelia project, with JSPM and SystemJS. During development mode, it works great. But when bundling, having some issues:
First is error "hashwords is not defined". This is caused by this line in
index.js
:Changing it to this fixes the problem:
However, that leads to the second problem: "md5 is not a function", in
hashwords.js
, functiontokensFromString
:This is because in bundled mode, this line in
hashwords.js
returns undefined:Just as an experiment, I modified
lib/md5.js
, removed the IIFE wrapping it, and instead of thedefine
check, replaced with node style module.exports, and that solved the problem:Does anyone know how to make this library work within a SystemJS bundle without modifying the code? Otherwise I could submit a PR with my fixes, except I'm not sure if this would break other usages such as via
bower install
.The text was updated successfully, but these errors were encountered: