Skip to content

Commit

Permalink
fix(node-resolve): use correct version when published
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Dec 14, 2021
1 parent 8c6ae32 commit c68c42b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/node-resolve/package.json
Expand Up @@ -66,7 +66,6 @@
"@babel/plugin-transform-typescript": "^7.10.5",
"@rollup/plugin-babel": "^5.1.0",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-json": "^4.1.0",
"es5-ext": "^0.10.53",
"rollup": "^2.58.0",
"source-map": "^0.7.3",
Expand Down
16 changes: 12 additions & 4 deletions packages/node-resolve/rollup.config.js
@@ -1,15 +1,23 @@
import json from '@rollup/plugin-json';

import { emitModulePackageFile } from '../../shared/rollup.config';

import pkg from './package.json';

export default {
input: 'src/index.js',
plugins: [json()],
plugins: [
{
name: 'external-package-json',
resolveId(source) {
if (source.endsWith('package.json')) {
return { id: '../../package.json', external: true };
}
return null;
}
}
],
external: [...Object.keys(pkg.dependencies), 'fs', 'path', 'os', 'util', 'url'],
onwarn: (warning) => {
throw new Error(warning);
throw Object.assign(new Error(), warning);
},
output: [
{ file: pkg.main, format: 'cjs', exports: 'named' },
Expand Down
2 changes: 0 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c68c42b

Please sign in to comment.