Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const safePackageName = (name: string) =>
name.toLowerCase().replace(/((^[^a-zA-Z]+)|[^\w.-])|([^a-zA-Z0-9]+$)/g, '');

export const external = (id: string) =>
!id.startsWith('.') && !id.startsWith('/');
!id.startsWith('.') && !path.isAbsolute(id);

// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebookincubator/create-react-app/issues/637
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/build-default/src/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const foo = () => 'bar';
2 changes: 2 additions & 0 deletions test/fixtures/build-default/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { foo } from './foo';

export const sum = (a: number, b: number) => {
if ('development' === process.env.NODE_ENV) {
console.log('fuck');
Expand Down
9 changes: 9 additions & 0 deletions test/tests/tsdx-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ describe('tsdx build', () => {
expect(output.code).toBe(0);
});

it('should create the library correctly', () => {
util.setupStageWithFixture(stageName, 'build-default');

shell.exec('node ../dist/index.js build');

const lib = require(`../../${stageName}/dist`);
expect(lib.foo()).toBe('bar');
});

afterEach(() => {
util.teardownStage(stageName);
});
Expand Down