build: allow use of BUILDFLAG directives from within JS code (#20328)
This commit is contained in:
parent
f9c04449f4
commit
392ea320cf
16 changed files with 132 additions and 74 deletions
|
@ -1,7 +1,5 @@
|
|||
// TODO: Updating this file also required updating the module-keys file
|
||||
|
||||
const features = process.electronBinding('features');
|
||||
|
||||
// Browser side modules, please sort alphabetically.
|
||||
export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'app', loader: () => require('./app') },
|
||||
|
@ -35,7 +33,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
|||
{ name: 'WebContentsView', loader: () => require('./web-contents-view') }
|
||||
];
|
||||
|
||||
if (features.isViewApiEnabled()) {
|
||||
if (BUILDFLAG(ENABLE_VIEWS_API)) {
|
||||
browserModuleList.push(
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') }
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue