Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shrynx/nodify
zero-config build tool system for Node.js
https://github.com/shrynx/nodify
build-tool nodejs rollup toolkit zero-configuration
Last synced: 8 days ago
JSON representation
zero-config build tool system for Node.js
- Host: GitHub
- URL: https://github.com/shrynx/nodify
- Owner: shrynx
- Archived: true
- Created: 2017-10-29T06:36:01.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T15:43:57.000Z (over 6 years ago)
- Last Synced: 2024-09-17T02:54:16.087Z (about 2 months ago)
- Topics: build-tool, nodejs, rollup, toolkit, zero-configuration
- Language: JavaScript
- Homepage:
- Size: 367 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-toolkits - nodify - Zero-config build tool system for Node.js. (Other)
README
# Nodify
![nodify-status](https://david-dm.org/shrynx/nodify.svg?path=packages/nodify-core)
[![npm version](https://badge.fury.io/js/nodify-core.svg)](https://badge.fury.io/js/nodify-core)Nodify is a build tool system for Node.js, allowing you to write next-generation
Node.js applications with zero configuration.## Getting started
### Assumptions
Nodify assumes by default the entry point of your application to be
`src/index.js` and will put output file in `build/main.js`, although everything
is customizable.* * *
### Installation
Main package is named `nodify-core`, install it as a **devDependency** in your
app.- via npm
```shell
npm i -D nodify-core
```- via yarn
```shell
yarn add -D nodify-core
```* * *
### Usage
Nodify is exposes two cli commands
- ### **nodify dev**
Runs nodify in development mode. Allowing you to execute code and reload on
change, also providing helpful errors.
![errors](https://user-images.githubusercontent.com/4706261/32256050-0fa77fa4-bef0-11e7-9326-e678cf7523ac.png)**NOTE**: nodify dev automatically sets `process.env.node` to `development`,
and generates source map to support debugging.
- ### **nodify build**
Builds app ready for production.
Build version will be outputted in `build/main.js`,
which you can run directly via node.
```shell
node ./build/main
```**NOTE**: nodify build automatically sets `process.env.node` to `production`,
and doesn't generate any source maps.
---Your `package.json` should look like
```javascript
{
..."scripts": {
"dev": "nodify dev",
"build": "nodify build",...
}...
}
```## Customization
Under the hood nodify uses [rollup](https://rollupjs.org/) and
[babel](https://babeljs.io/), which come pre-configured, but can with be
completely customized.### Rollup
To customize rollup config, create a `nodify.config.js` in the root directory of
your app.```javascript
module.exports = {
rollup: (config, env) => {
// access the config here
// also process.env.NODE_ENV can be accessed using env
// and customize it as you wish
// finally remember to return the modified config.
// by default during dev process.env.NODE_ENV is 'development'
// and during build process.env.NODE_ENV is 'production'
return config;
},
};
```Checkout the example for
[custom rollup config](https://github.com/shrynx/nodify/tree/master/examples/custom-rollup)**NOTE**: The default config for rollup can be found [here](https://github.com/shrynx/nodify/blob/master/packages/nodify-core/config/rollup.config.js).
### Babel
To customize babel plugins and presets configuration, create a `.babelrc` file
in the root directory of your app.If this file exists nodify will rely upon it rather than its internal
configuration, therefore you must use nodify preset in your babelrc file, to
make it work with nodify.Your `.babelrc` should look like
```javascript
{
"presets": [
"nodify-core/babel",
// add other presets
],
"plugins": [
// add plugins
]
...
}
```Checkout the example for
[custom babel config](https://github.com/shrynx/nodify/tree/master/examples/custom-babel)## Built with
- [rollup](https://rollupjs.org/)
- [babel](https://babeljs.io/)
- [nodemon](https://nodemon.io/)## Examples
Please refer the
[examples](https://github.com/shrynx/nodify/tree/master/examples) folder for
basic setups with different configurations.## Acknowledgement
### Prior Art
[Backpack](https://github.com/jaredpalmer/backpack) - Works in same way and uses
`webpack`.### Inspiration
- [backend-with-webpack](http://jlongster.com/Backend-Apps-with-Webpack--Part-I)
by [@jlongster](https://github.com/jlongster) for explaining the need of build
tools on node backend.- [create-react-app](https://github.com/facebookincubator/create-react-app) for
popularizing pre-configured tools that help jump start development.- [next.js](https://github.com/zeit/next.js) for creating customizable
configurations.## License
MIT