Skip to content

Commit

Permalink
Merge pull request #83 from devraul/master
Browse files Browse the repository at this point in the history
refactor: automate build with rollup
  • Loading branch information
anikethsaha committed Dec 22, 2019
2 parents 463f642 + b072543 commit b8183cd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.DS_Store
.vscode/
node_modules/
yarn.lock
yarn.lock
bin/
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ cache:
- ./node_modules
install:
- npm install
- npm run build
7 changes: 2 additions & 5 deletions bin/docsify → lib/cli.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env node

"use strict";
const chalk = require("chalk");
const updateNotifier = require("update-notifier");

const pkg = require("../package.json");
const run = require("../lib");
const chalk = require("chalk");
const updateNotifier = require("update-notifier");

updateNotifier({ pkg: pkg }).notify();

Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
"docsify": "bin/docsify"
},
"scripts": {
"test": "ava e2e/index.js",
"release": "standard-version"
"test": "ava e2e/index.js",
"release": "standard-version",
"prebuild": "rimraf bin",
"build": "rollup -c",
"prerelease": "npm run build"
},
"files": [
"bin",
Expand Down Expand Up @@ -52,6 +55,9 @@
"cors": "^2.8.1",
"eslint": "^6.5.1",
"execa": "^4.0.0",
"rimraf": "^3.0.0",
"rollup": "^1.27.13",
"rollup-plugin-executable": "^1.5.2",
"standard-version": "^7.0.1"
},
"keywords": [
Expand Down
11 changes: 11 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import executable from "rollup-plugin-executable";

module.exports = {
input: "lib/cli.js", // Entry file
plugins: [executable()],
output: {
file: "bin/docsify",
format: "cjs", // Compiles to CJS
banner: "#!/usr/bin/env node" // Adds node shebang on top of the file
}
};

0 comments on commit b8183cd

Please sign in to comment.