Skip to content

Commit 89ada2e

Browse files
committed
add rollup to package module
1 parent 1ff8143 commit 89ada2e

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

blob.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {Point, BlobOptions} from "./types";
88
export {BlobOptions} from "./types";
99

1010
// Generates a random rounded shape.
11-
export const blob = (opt: BlobOptions): string => {
11+
const blobs = (opt: BlobOptions): string => {
1212
// Random number generator.
1313
const rgen = rand(opt.seed || String(Date.now()));
1414

@@ -55,17 +55,4 @@ export const blob = (opt: BlobOptions): string => {
5555
});
5656
};
5757

58-
console.log(
59-
blob({
60-
color: "pink",
61-
complexity: 0.4,
62-
seed: "16",
63-
contrast: 0.4,
64-
size: 400,
65-
guides: true,
66-
stroke: {
67-
color: "red",
68-
width: 1,
69-
},
70-
}),
71-
);
58+
export default blobs;

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
"scripts": {
1010
"prepack": "npm run build",
1111
"postpublish": "npm run clean",
12-
"build": "npm run clean && tsc",
12+
"build": "npm run clean && rollup -c rollup.config.ts",
1313
"clean": "trash '**/*.js' '**/*.js.map' '**/*.d.ts' '!**/node_modules/**/*'",
1414
"fmt": "prettier --list-different --write --ignore-path .gitignore '**/*.{js,ts}'"
1515
},
1616
"devDependencies": {
1717
"prettier": "^1.14.2",
18+
"rollup": "^1.1.0",
19+
"rollup-plugin-typescript2": "^0.18.1",
1820
"trash-cli": "^1.4.0",
21+
"tslib": "^1.9.3",
1922
"typescript": "^3.1.3"
2023
},
2124
"homepage": "https://github.com/g-harel/blobs#readme",

rollup.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import typescript from "rollup-plugin-typescript2";
2+
3+
export default {
4+
input: "./index.ts",
5+
output: {
6+
file: "index.js",
7+
format: "umd",
8+
name: "blobs",
9+
},
10+
plugins: [typescript({cacheRoot: "./node_modules/.cache/rpt2"})],
11+
};

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"compilerOptions": {
88
"target": "es5",
9-
"module": "commonjs",
9+
"module": "es2015",
1010
"moduleResolution": "node",
1111
"esModuleInterop": true,
1212
"lib": [

0 commit comments

Comments
 (0)