Compare commits

...

2 Commits

Author SHA1 Message Date
Aaron Klinker 9fad20332f 0.19.1-alpha2 2024-07-27 08:58:58 -05:00
Aaron Klinker b530815065 Remove main function from entrypoint before auto-imports 2024-07-27 08:58:08 -05:00
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "wxt",
"type": "module",
"version": "0.19.1-alpha1",
"version": "0.19.1-alpha2",
"description": "Next gen framework for developing web extensions",
"repository": {
"type": "git",
@@ -14,8 +14,11 @@ export function removeEntrypointMainFunction(
const absPath = normalizePath(resolve(config.root, path));
return {
name: 'wxt:remove-entrypoint-main-function',
transform(code, id) {
if (id === absPath) return removeMainFunctionCode(code);
transform: {
order: 'pre',
handler(code, id) {
if (id === absPath) return removeMainFunctionCode(code);
},
},
};
}
@@ -5,14 +5,12 @@ export interface Environment {
export function createEnvironment(getGlobals: () => EnvGlobals): Environment {
const setup = () => {
console.log('SETUP');
const envGlobals = getGlobals();
const ogGlobals = getOgGlobals(envGlobals);
applyGlobals(envGlobals);
return () => {
applyGlobals(ogGlobals);
console.log('TEARDOWN');
};
};
const run = async (fn: () => any) => {