Skip to content

Commit

Permalink
Add semicolon at the end of UMD build (#129)
Browse files Browse the repository at this point in the history
Allows for safe script concatenation; see Tampermonkey/tampermonkey#595
  • Loading branch information
lelinhtinh committed Apr 5, 2022
1 parent c9becc4 commit 80c12de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/buildUMD.ts
Expand Up @@ -32,7 +32,7 @@ minify(src, opts).then(async out => {
const res = "!function(f){typeof module!='undefined'&&typeof exports=='object'?module.exports=f():typeof define!='undefined'&&define.amd?define(f):(typeof self!='undefined'?self:this).fflate=f()}(function(){var _e={};" +
out.code!.replace(/exports\.(.*) = void 0;\n/, '').replace(/exports\./g, '_e.').replace(/require\("\.\/node-worker\.cjs"\)/,
"(typeof module!='undefined'&&typeof exports=='object'?function(_f){" + nodeWkrOut + 'return _f}:function(_f){' + wkrOut + 'return _f})({})'
) + 'return _e})';
) + 'return _e});';
if (!existsSync(p('umd'))) mkdirSync(p('umd'));
writeFileSync(p('umd', 'index.js'), res);
});

0 comments on commit 80c12de

Please sign in to comment.