Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react): copy README on buildable libs #3091

Merged
merged 1 commit into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions e2e/react-package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ forEachCli('nx', (cli) => {
checkFilesExist(`dist/libs/${childLib}/assets/hello.txt`);
});

it('should copy the README to dist', () => {
const output = runCLI(`build ${childLib2}`);
expect(output).toContain(`Bundle complete`);
checkFilesExist(`dist/libs/${childLib2}/README.md`);
});

it('should properly add references to any dependency into the parent package.json', () => {
const childLibOutput = runCLI(`build ${childLib}`);
const childLib2Output = runCLI(`build ${childLib2}`);
Expand Down
7 changes: 7 additions & 0 deletions packages/react/src/schematics/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ function addProject(options: NormalizedSchema): Rule {
external,
babelConfig: `@nrwl/react/plugins/bundle-babel`,
rollupConfig: `@nrwl/react/plugins/bundle-rollup`,
assets: [
{
glob: 'README.md',
input: '.',
output: '.',
},
],
},
};
}
Expand Down