mirror of
https://github.com/khairul169/code-share.git
synced 2026-10-24 11:53:58 +07:00
feat: using swc as transpiler
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
if (window.parent !== window) {
|
||||
const _log = console.log;
|
||||
const _error = console.error;
|
||||
const _warn = console.warn;
|
||||
|
||||
console.log = function (...args) {
|
||||
parent.window.postMessage({ type: "log", args: args }, "*");
|
||||
_log(...args);
|
||||
};
|
||||
console.error = function (...args) {
|
||||
parent.window.postMessage({ type: "error", args: args }, "*");
|
||||
_error(...args);
|
||||
};
|
||||
console.warn = function (...args) {
|
||||
parent.window.postMessage({ type: "warn", args: args }, "*");
|
||||
_warn(...args);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user