1.1.0 • Published 7 years ago
gulp-ngn-js v1.1.0
Requirements
- PHP 5.6 CLI installed
- Download Ngn components
mkdir ngn-env
cd ngn-env
git clone https://github.com/majexa/ngn.git
git clone https://github.com/majexa/ngn-cs.git
git clone https://github.com/majexa/run.git
git clone https://github.com/mootools/mootools-core
git clone https://github.com/mootools/mootools-more
Usage
Contents of index.html
<script>
new Ngn.SomeClass();
</script>
Next gulp task will parse <script>
tags in index.html and build all founded NgnJS classes with it dependencies.
var gulp = require('gulp');
var ngnJs = require('gulp-ngn-js');
gulp.task('build', function () {
var opt = {
ngnEnvFolder: process.env.NGN_ENV_FOLDER,
buildFolder: process.env.PROJECT_FOLDER + '/build/public/m',
projectFolder: process.env.PROJECT_FOLDER,
name: 'main',
jsonFieldsFolder: process.env.PROJECT_FOLDER + '/models'
};
var reportOptions = {
err: true,
stderr: true,
stdout: true
};
gulp.src('index.html', {read: false})
.pipe(ngnJs(opt))
.pipe(ngnJs.reporter(reportOptions))
});