Tweaks for in-browser use
This commit is contained in:
parent
3465f6b322
commit
8c2729e3d8
|
@ -11,6 +11,7 @@ function umd(insertion, extra) {
|
|||
file: distfile(insertion),
|
||||
format: 'umd',
|
||||
name: 'SyndicateCompiler',
|
||||
sourcemap: true,
|
||||
... (extra || {})
|
||||
};
|
||||
}
|
||||
|
@ -19,6 +20,7 @@ function es6(insertion, extra) {
|
|||
return {
|
||||
file: distfile('.es6' + insertion),
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
... (extra || {})
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ function umd(insertion, extra) {
|
|||
file: distfile(insertion),
|
||||
format: 'umd',
|
||||
name: 'Syndicate',
|
||||
sourcemap: true,
|
||||
globals: {
|
||||
'crypto': 'crypto',
|
||||
},
|
||||
|
@ -22,6 +23,7 @@ function es6(insertion, extra) {
|
|||
return {
|
||||
file: distfile('.es6' + insertion),
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
... (extra || {})
|
||||
};
|
||||
}
|
||||
|
|
|
@ -118,11 +118,12 @@ export class Ground extends Dataspace {
|
|||
// if (k) k(g);
|
||||
// }
|
||||
|
||||
export function bootModule(bootProc: Script<void>): void {
|
||||
export function bootModule(bootProc: Script<void>): Ground {
|
||||
const g = new Ground(bootProc);
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('DOMContentLoaded', () => g.start());
|
||||
} else {
|
||||
g.start();
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepare": "npm run compile",
|
||||
"compile": "npx syndicatec -o index.js --module require index.syndicate.js",
|
||||
"compile": "npx syndicatec -o index.js --module global --runtime Syndicate index.syndicate.js",
|
||||
"clean": "rm -f index.js"
|
||||
},
|
||||
"author": "Tony Garnock-Jones <tonyg@leastfixedpoint.com>",
|
||||
|
|
Loading…
Reference in New Issue