Skip to content

Commit

Permalink
build(rollup): fix rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Sep 5, 2020
1 parent 9c4546b commit a7d6167
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# examples yarn.lock
examples/*/yarn.lock
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
examples
1 change: 0 additions & 1 deletion index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "data-transport",
"version": "0.0.1",
"version": "0.0.2",
"description": "A common transporter",
"main": "lib/index.js",
"unpkg": "dist/index.umd.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "jest",
Expand Down
11 changes: 4 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ export default isProduction
file: 'dist/index.cjs.js',
sourcemap: true,
},
{
format: 'es',
exports: 'named',
file: pkg.module,
sourcemap: true,
},
{
format: 'umd',
name: 'DataTransport',
name: pkg.name
.split('-')
.map(([s, ...rest]) => [s.toUpperCase(), ...rest].join(''))
.join(''),
file: pkg.unpkg,
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions src/transport.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as uuid from 'uuid';
import { v4 } from 'uuid';
import {
listenKey,
originalRespondsMapKey,
Expand Down Expand Up @@ -108,7 +108,7 @@ export abstract class Transport<T extends TransportDataMap = any> {
): Promise<Response<T[K]>> {
const hasRespond = options.respond ?? true;
const timeout = options.timeout ?? this[timeoutKey];
const transportId = uuid.v4();
const transportId = v4();
if (!hasRespond) {
return new Promise((resolve) => {
this[sendKey]({
Expand Down

0 comments on commit a7d6167

Please sign in to comment.