Skip to content

Commit

Permalink
fix: package overriding (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph authored Apr 17, 2023
1 parent d01de08 commit f5290b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import importFrom from 'import-from';
import {convertPathToImport} from "./utils/resolve-module.mjs";
import {mapSourceToOutputFiles} from "./utils/map-inputs-outputs.mjs";

export default ({ package: packageOverride, globalConfig, projectConfig, tests }) => {
export default ({ package: packageMiddleware, globalConfig, projectConfig, tests }) => {
return {
name: 'jest',
async setup(build) {
Expand Down Expand Up @@ -70,7 +70,7 @@ export default ({ package: packageOverride, globalConfig, projectConfig, tests }
return packageJson ? [dep, packageJson.version] : null;
}).filter(Boolean));

await writeFile(join(outdir, 'package.json'), JSON.stringify({
await writeFile(join(outdir, 'package.json'), JSON.stringify(packageMiddleware({
name: 'bundled-tests',
version: '0.0.0',
type: 'module',
Expand All @@ -81,8 +81,7 @@ export default ({ package: packageOverride, globalConfig, projectConfig, tests }
dependencies: {
...externalDependencies,
},
...packageOverride,
}, null, 2));
}), null, 2));
});
},
};
Expand Down

0 comments on commit f5290b3

Please sign in to comment.