-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6209c5c
commit a569191
Showing
12 changed files
with
487 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
dist | ||
build | ||
node_modules | ||
npm-debug.log* | ||
package-lock.json | ||
.eslintcache | ||
.DS_Store | ||
.cache | ||
.vscode | ||
|
||
*.bak | ||
*.tem | ||
*.temp | ||
#.swp | ||
*.*~ | ||
~*.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Basic Example for bundle-node | ||
=== | ||
|
||
Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style. A tool created based on [`kkt`](https://github.com/kktjs/kkt) & [`create-react-app`](https://github.com/facebook/create-react-app), [`@kkt/ncc`] similar to [@vercel/ncc](https://www.npmjs.com/package/@vercel/ncc) | ||
|
||
## Quick Start | ||
|
||
```bash | ||
$ npx create-kkt my-app -e bundle-node | ||
cd my-app | ||
npm install | ||
``` | ||
|
||
**production** | ||
|
||
Builds the app for production to the build folder. | ||
|
||
```bash | ||
npm run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "@template/bundle-node", | ||
"version": "7.1.0", | ||
"description": "", | ||
"private": true, | ||
"scripts": { | ||
"build": "npm run bundle && npm run bundle:min", | ||
"bundle": "ncc build src/app.ts", | ||
"watch": "ncc start src/app.ts", | ||
"bundle:min": "ncc build src/app.ts -m" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kktjs/kkt.git" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@types/hapi__hapi": "20.0.10", | ||
"@hapi/hapi": "20.2.1" | ||
}, | ||
"devDependencies": { | ||
"@kkt/ncc": "1.0.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Hapi from '@hapi/hapi'; | ||
|
||
const init = async () => { | ||
const server = new Hapi.Server({ | ||
port: 3000, | ||
host: 'localhost', | ||
}); | ||
|
||
server.route({ | ||
method: 'GET', | ||
path: '/', | ||
handler: (request, h) => { | ||
return 'Hello World!'; | ||
}, | ||
}); | ||
console.log('WCJ'); | ||
await server.start(); | ||
console.log('Server running on %s', server.info.uri); | ||
}; | ||
|
||
process.on('unhandledRejection', (err) => { | ||
console.log(err); | ||
process.exit(1); | ||
}); | ||
|
||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2015", | ||
"moduleResolution": "node", | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"baseUrl": "./src", | ||
"noEmit": false | ||
}, | ||
"include": ["src/**/*", ".kktrc.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@kkt/ncc | ||
=== | ||
|
||
Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style. A tool created based on [`kkt`](https://github.com/kktjs/kkt) & [`create-react-app`](https://github.com/facebook/create-react-app), [`@kkt/ncc`] similar to [@vercel/ncc](https://www.npmjs.com/package/@vercel/ncc) | ||
|
||
## Usage | ||
|
||
### Installation | ||
|
||
```bash | ||
npm i -g @kkt/ncc | ||
``` | ||
|
||
### Usage | ||
|
||
```bash | ||
$ ncc <cmd> [input-file] [opts] | ||
# input-file default value: src/index.ts | ||
``` | ||
|
||
### Eg: | ||
|
||
```bash | ||
$ ncc build input.js -o dist | ||
``` | ||
|
||
Outputs the `Node.js` compact build of `input.js` into `dist/input.js`. | ||
|
||
## Commands | ||
|
||
```bash | ||
Usage: ncc [build] [input-file] [--help|h] | ||
|
||
Displays help information. | ||
|
||
Options: | ||
|
||
--version, -v Show version number | ||
--help, -h Displays help information. | ||
-o, --out [dir] Output directory for build (defaults to dist). | ||
-m, --minify Minify output. | ||
-s, --source-map Generate source map. | ||
-e, --external [mod] Skip bundling 'mod'. Can be used many times. | ||
|
||
Example: | ||
|
||
$ ncc build | ||
$ ncc build --out ./dist | ||
$ ncc build --minify | ||
$ ncc build src/app.ts | ||
$ ncc build --source-map | ||
``` | ||
|
||
### License | ||
|
||
Licensed under the MIT License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "@kkt/ncc", | ||
"version": "1.0.0", | ||
"description": "Simple CLI for compiling a Node.js module into a single file, together with all its dependencies, gcc-style.", | ||
"author": "Kenny Wong <wowohoo@qq.com> (https://github.com/jaywcjlove)", | ||
"repository": "https://github.com/kktjs/kkt/tree/master/packages/ncc", | ||
"license": "MIT", | ||
"bin": { | ||
"ncc": "./lib/index.js" | ||
}, | ||
"keywords": [ | ||
"kkt", | ||
"ncc", | ||
"nodejs", | ||
"cra", | ||
"build-tools", | ||
"create-react-app", | ||
"zero-configuration", | ||
"framework" | ||
], | ||
"dependencies": { | ||
"css-minimizer-webpack-plugin": "3.3.1", | ||
"kkt": "7.1.0" | ||
} | ||
} |
Oops, something went wrong.