Skip to content

Commit

Permalink
fix: type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed Aug 8, 2024
1 parent f6f47e8 commit a944a94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/builder/bundless/loaders/javascript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ export interface ITransformerItem {
export function addTransformer(item: ITransformerItem) {
const mod = require(item.transformer);
const transformer: IJSTransformer = mod.default || mod;

transformers[item.id] = transformer;
}

/**
* builtin javascript loader
*/
const jsLoader: IBundlessLoader = function (content) {
let transformer = this.transformers[this.config.transformer!];
const transformer = this.transformers[this.config.transformer!];
if (typeof transformer.fn !== 'function') {
const mod = require(this.transformers[this.config.transformer!]
.resolvePath as string);
Expand Down
2 changes: 1 addition & 1 deletion src/builder/bundless/loaders/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type IBundlessLoader = (
this: Omit<ExtendedLoaderContext, 'async'> &
ILoaderContext & {
cwd: string;

transformers: Record<string, IJSTransformer>;
itemDistAbsPath: string;

/**
Expand Down

0 comments on commit a944a94

Please sign in to comment.