mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-10-28 22:47:54 +03:00
* window.bundle.js seems to work * minify * Use API instead of CLI * Add remote bundle * Perform code-splitting * Add background and stop code-splitting * Add other entrypoints * Flesh out some more * Keep going * Copy to browser directories * Ignore import type error * Strip out webpack stuff * Remove todos * Remove pug imports * Fix
20 lines
575 B
TypeScript
20 lines
575 B
TypeScript
// @ts-ignore
|
|
import script from '../dist/page.bundle.js';
|
|
|
|
let s = document.createElement('script');
|
|
s.type = 'text/javascript';
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
s.appendChild(document.createTextNode(script));
|
|
(document.head || document.documentElement).appendChild(s);
|
|
s.parentNode!.removeChild(s);
|
|
} else {
|
|
s.src = chrome.extension.getURL('page.bundle.js');
|
|
s.onload = function () {
|
|
(this as HTMLScriptElement).parentNode!.removeChild(
|
|
this as HTMLScriptElement,
|
|
);
|
|
};
|
|
(document.head || document.documentElement).appendChild(s);
|
|
}
|