Skip to content

Commit

Permalink
✨ feat: 添加 extends 字段
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Apr 16, 2021
1 parent 97a785d commit caf65d8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example/.umirc.ts
Expand Up @@ -35,5 +35,8 @@ export default defineConfig({
entries: ['@/contentScripts/baidu'],
},
],
extends: {
web_accessible_resources: ['*'],
},
},
});
1 change: 1 addition & 0 deletions src/functions/configSchema.ts
Expand Up @@ -179,6 +179,7 @@ export default (api: IApi) => {
}),
),
icons: iconSchema,
extends: joi.object(),
});
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/utils/manifest.ts
Expand Up @@ -72,6 +72,7 @@ export const generateManifestFromConfig = (
minimumChromeVersion: minimum_chrome_version,
contentScripts,
version,
extends: origin,
...manifest
} = config;

Expand Down Expand Up @@ -138,6 +139,7 @@ export const generateManifestFromConfig = (
...manifest,
...option,
...popup,
...origin,
version: validateVersion(version),
background: backgroundStr,
manifest_version,
Expand Down
5 changes: 5 additions & 0 deletions types/extensionsPlugin/index.d.ts
Expand Up @@ -40,6 +40,11 @@ declare namespace extensionsPlugin {
* 注入脚本
*/
contentScripts: ContentScript[];

/**
* 在这里书写原有的 manifest
*/
extends?: Partial<chromeManifest.Manifest>;
}

/**
Expand Down

0 comments on commit caf65d8

Please sign in to comment.