DevCode Init
DevCode management for DevCode's plugins. It contains Gulp tasks: default, build, clean, watch and init-config.
Getting started
Prerequisites
What things you need:
How to install
Install it as devDependency:
npm install -D @devcode/init
How to use
Include it in gulpfile.js
:
const gulp = require('gulp')
const init = require('@devcode/init')
const plugins = {
browserSync: require('@devcode/browser-sync')
}
const env = process.argv.includes('build') ? 'production' : 'development'
init({
gulp, // required
env, // required
plugins: { // required
reload: [plugins.browserSync],
assets: [...],
code: [...],
static: [...]
}
})
API
init: function (settings: object)
The init
function needs env
(string 'development' or 'production') and plugins
which contains four keys: reload
, assets
, code
and static
. Each key can contain array of plugins. In the Gulp tasks default
and build
are plugins kept in the chronological order: clean
, [plugins.assets]
, [plugins.code]
, [plugins.static]
, and for the default
task as the last is (watch
).
Configuration
-
src: string
- name of the folder with source code -
dist: string
- name of the folder with distribution code
module.exports = {
src: 'src',
dist: 'build'
}
Built with
- Gulp - the streaming build system
- gulp-sequence - runs a series of gulp tasks in order
- del - deletes files and folders using globs
- Prettier - the opinionated code formatter
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning.
Authors
- Matej Mazur - Initial work - GitHub account
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgements
- This project was inspired by Blendid