Skip to content

Commit

Permalink
feat: allow pass parse options to api parser (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript authored Mar 17, 2023
1 parent e71a26a commit 7819c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/assetParsers/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class AtomAssetsParser {
resolveFilter?: AtomAssetsParser['resolveFilter'];
unpkgHost?: string;
watch?: boolean;
parseOptions?: object;
}) {
const absEntryFile = path.resolve(opts.resolveDir, opts.entryFile);

Expand All @@ -46,6 +47,8 @@ class AtomAssetsParser {
basePath: getProjectRoot(opts.resolveDir),
unPkgHost: opts.unpkgHost ?? 'https://unpkg.com',
mode: 'worker',
// @ts-ignore
parseOptions: opts.parseOptions,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/features/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default (api: IApi) => {
Joi.object({
unpkgHost: Joi.string().uri().optional(),
resolveFilter: Joi.function().optional(),
parseOptions: Joi.object().optional(),
}),
},
});
Expand Down Expand Up @@ -54,6 +55,7 @@ export default (api: IApi) => {
resolveDir: api.cwd,
unpkgHost: api.config.apiParser!.unpkgHost,
resolveFilter: api.config.apiParser!.resolveFilter,
parseOptions: api.config.apiParser!.parseOptions,
});
});

Expand Down

0 comments on commit 7819c86

Please sign in to comment.