A starter kit to get you up and running with a bunch of awesome new front-end technologies using Gulp, Babel, Webpack, Mocha, Sinon-chai, Isparta, and ESLint without any framework dependencies.
Node >= 5.
If you migrate from Babel >= 5.x to Babel >= 6.x, your code will probably break because
Babel now have killed the CommonJS default export behaviour.
As a workaround, replace export default { … } with module.exports = { … }
Just clone the repo and install the necessary node modules.
$ git clone https://github.com/kflash/gulps.git gulps $ cd gulps$ npm install # Install Node modules listed in /packagejson$ npm webpack # Build a non-minified version of the librarynpm run packages - List installed packagesnpm run package:purge - Remove all dependenciesnpm run package:reinstall - Reinstall all dependenciesnpm run package:check - shows a list over dependencies with a higher version number then the current one - if anynpm run package:upgrade - Automaticly upgrade all devDependencies & dependencies, and update package.jsonnpm run package:dev - Automaticly upgrade all devDependencies and update package.jsonnpm run package:prod - Automaticly upgrade all dependencies and update package.jsongulp dev - Build task that generate compiled scriptgulp prod - Build task that generate a minified script for productiongulp clean - Remove the dist folder and it's filesgulp lint:source - Lint the sourcegulp lint:test - Lint the unit testsgulp test - Runs unit testsgulp watch - Run all unit tests & watch files for changesgulp coverage - Generates a coverage reportgulp browser - Let you run unit tests in your browser.gulp gzip - Gzip the compiled scriptgulp help - Lists all available gulp tasks from your gulpfile.This project uses Mocha to run your unit tests. By default all units tests runs on the server side.
To add a unit test, simply create .js file inside the ~/test/specs folder, and Mocha and Chai will be available within your unit tests without the need to import them.
To run the tests in the project, just simply gulp test.
To keep watching the common test suites that you are working on, simply do gulp watch.
To run your unit tests in the browser, do gulp browser, and then open the ~/test/runner.html in your browser.
This library is set up to integrate with Isparta, and will automaticly publish your coverage report if you have created an account for your repo at coveralls.io. You can also run gulp coverage to generate the coverage report in your CLI.
This boilerplate project uses ESLint and the Airbnb styleguide to lint your source. To change the rules, edit the .eslintrc file in the root directory, respectively.
Gulps has build-in some nice features to always make sure your dependency tree are up to date.
To check for the latest dependencies, simply run npm run package:check.
If you want to update your packages, you can simply do npm run package:upgrade.
Note! Your package.json will be automatically updated so make sure you have saved your changes before running this.
To reinstall all packages, do npm run package:reinstall, and to remove all packages npm run package:purge.
This boilerplate uses a pre-commit hook to ensure that your npm test (or other specified scripts) passes before you can commit your changes. This all conveniently configured in your package.json.
Each time you clone the repo, use:
npm install Yes, for small applications. For a larger project, you'll need to customize the boilerplate after your own needs, but that is out of scope of this boilerplate.
This transpiler works best in IE9+, but you can support IE8 by limiting yourself to a subset of ES2015 features.
You can use Gulp for that. On the command line you can do gulp --env='prod.
In the gulp taks, you can use gulp-utils: .pipe(gutil.env.env === 'prod' ? minifySomething() : gutil.noop())
MIT © KFlash