nodify-core
Nodify is a build tool system for Node.js
Last updated 2 years ago by shriyans .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nodify-core 
SYNC missed versions from official npm registry.

Nodify

nodify-status npm version

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

    npm i -D nodify-core
    
  • via yarn

    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

    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.

    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

{
  ...

  "scripts": {
    "dev": "nodify dev",
    "build": "nodify build",

    ...
  }

  ...
}

Customization

Under the hood nodify uses rollup and babel, 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.

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

NOTE: The default config for rollup can be found here.

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

{
  "presets": [
    "nodify-core/babel",
    // add other presets
  ],
  "plugins": [
    // add plugins
  ]
  ...
}

Checkout the example for custom babel config

Built with

Examples

Please refer the examples folder for basic setups with different configurations.

Acknowledgement

Prior Art

Backpack - Works in same way and uses webpack.

Inspiration

License

MIT

Current Tags

  • 5.0.0-alpha.1                                ...           beta (2 years ago)
  • 5.0.1                                ...           latest (2 years ago)

22 Versions

  • 5.0.1                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 5.0.0-alpha.1                                ...           2 years ago
  • 4.0.6                                ...           2 years ago
  • 4.0.5                                ...           2 years ago
  • 4.0.4                                ...           2 years ago
  • 4.0.3                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 4.0.0--alpha                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 3.0.0-alpha4                                ...           2 years ago
  • 3.0.0-alpha3                                ...           2 years ago
  • 3.0.0-alpha2                                ...           2 years ago
  • 3.0.0-alpha                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-3                                ...           2 years ago
  • 1.0.0-2                                ...           2 years ago
  • 1.0.0-1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 0
Last Month 1
Dependencies (15)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |