Common dev tasks as a module.
Swappable means ezy won't pollute your
package.json file with config details. The idea is to start with ezy and add in your config details when you need them.
Note: This project will be unstable until v1.0.0.
$ npm install ezy -g
Note: at the moment ezy only works in global mode.
If you're starting from scratch, the first thing to do is to create your project directory, where
<project> is your project's name.
ezy new <project>
cd into your new project and run npm init.
Run ezy as a global command:
ezy in your new project dir will ask you to create an ezy.config.json file and an entry js file.
This creates a simple dir structure:
/project-name/ src- index.js- ezy.config.json- package.json
"entryDir": "src""entry": "index.js""outputDir": "dist""output": "bundle.js""outputBrowserSuffix": "browser""testDir": "test"
Once this file has been generated, ezy will run again and you'll be presented with a number of tasks.
If you plan on using ES6, it's best to run the babel preset generator before running tests or bundling.
Node - Running a project in node mode is the same as running
ES6 - Running a project in ES6 mode will rollup
src/index.js with ES6 and pipe it to
Browser - Running a project in browser mode will first check to see if there is an index.html file in your outputDir, if not, ezy will ask you to generate it and finally use browser-sync to run all files in the outputDir.
In browser mode, you may still need to use "browserify" or equivalent on your output bundle and adjust your index.html file.
"scripts":"browserify": "browserify dist/bundle.js -o bundle-browser.js""bundle": "ezy bundle; npm run browserify""browser": "npm run bundle; ezy run browser"
$ ezy bundle - Bundles up your project like normal.
$ ezy test - Tests your project with tape. With or without ES6.
$ ezy run <es6/node/browser> - Runs your project with node or the browser.
$ ezy new <name> - Simply creates a dir with the specified name and generates a command for npm init.