- Update React Native, React, Remix and Vue library generators to produce `exports` in the `package.json` for the TS solution setup - Fix an issue in `@nx/rollup/with-nx` where an unhandled `undefined` plugin was causing an error to be thrown - Fix output path of the build task for React Native libraries in the TS solution setup <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
29 lines
777 B
TypeScript
29 lines
777 B
TypeScript
import type { PackageJson } from 'nx/src/utils/package-json';
|
|
import type { NormalizedSchema } from '../schema';
|
|
|
|
export function determineEntryFields(
|
|
options: NormalizedSchema
|
|
): Pick<PackageJson, 'module' | 'types' | 'exports'> {
|
|
if (options.bundler === 'none') {
|
|
return {
|
|
module: options.js ? './src/index.js' : './src/index.ts',
|
|
types: options.js ? './src/index.js' : './src/index.ts',
|
|
exports: {
|
|
'.': options.js
|
|
? './src/index.js'
|
|
: {
|
|
types: './src/index.ts',
|
|
import: './src/index.ts',
|
|
default: './src/index.ts',
|
|
},
|
|
'./package.json': './package.json',
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
module: './dist/index.mjs',
|
|
types: './dist/index.d.ts',
|
|
};
|
|
}
|