Remove decorators and bundler workarounds

This commit is contained in:
Jason Miller
2020-08-19 23:41:35 -04:00
parent d383fa6b12
commit e6111be998
20 changed files with 118 additions and 188 deletions

View File

@@ -1,18 +1,7 @@
declare module '@webcomponents/custom-elements';
// Patch Worker to ignore `importScripts("x.css")` generated by Parcel:
const W = self.Worker;
self.Worker = function (url: string | URL, options?: WorkerOptions) {
const code = `
importScripts=(function(){
return this.apply(self,[].slice.call(arguments).map(function(x){return !/\\.css$/i.test(x) && new URL(x,self.url).href}).filter(Boolean))
}).bind(importScripts);importScripts(self.url=${JSON.stringify(url)})
`.trim();
return new W(URL.createObjectURL(new Blob([code], { type: 'text/javascript' })), options);
} as any as (typeof Worker);
function init() {
require('./init-app.tsx');
import('./init-app.tsx');
}
if (!('customElements' in self)) {