Skip to content

Commit

Permalink
🔧 Add new build system
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Dec 18, 2019
1 parent 19a80a6 commit 452f9ac
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const gulp = require("gulp");
const rollup = require("rollup");
const rollupTypescript = require("@rollup/plugin-typescript");
const exec = require("child_process").exec;

gulp.task("build", async function () {
const bundle = await rollup.rollup({
input: "./src/index.ts",
plugins: [
rollupTypescript()
]
});

exec("tsc");

await bundle.write({
file: "./dist/index.umd.js",
format: "umd",
name: "uppload",
sourcemap: true
});

await bundle.write({
file: "./dist/index.cjs.js",
format: "cjs",
sourcemap: true
});

await bundle.write({
file: "./dist/index.amd.js",
format: "amd",
sourcemap: true
});
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"upload",
"javascript"
],
"main": "dist/index.js",
"main": "dist/index.umd.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand All @@ -29,7 +29,7 @@
"scripts": {
"build": "npm run build-package && node scripts/build-scss.js",
"test": "jest",
"build-package": "tsc",
"build-package": "gulp build",
"build-site": "site",
"build-demo": "parcel build demo/index.html",
"demo": "parcel demo/index.html",
Expand Down

0 comments on commit 452f9ac

Please sign in to comment.