https://github.com/dnbard/gulp-melchior
Gulp plugin for Melchior.js modules optimization
https://github.com/dnbard/gulp-melchior
Last synced: over 1 year ago
JSON representation
Gulp plugin for Melchior.js modules optimization
- Host: GitHub
- URL: https://github.com/dnbard/gulp-melchior
- Owner: dnbard
- Created: 2014-09-23T13:57:59.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-13T15:29:18.000Z (over 11 years ago)
- Last Synced: 2025-02-26T06:38:16.367Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 172 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Gulp Melchior
=============
Optimize (concatenate) [melchior.js](https://github.com/voronianski/melchior.js) projects using Gulp plugin.
Getting Started
---------------
If you haven't used [Gulp](http://gulpjs.com/) before, be sure to check out the [Getting Started](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started) guide, as it explains how to create a `Gulpfile` as well as install and use Gulp plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install gulp-melchior --save-dev
```
Once the plugin has been installed, it may be enabled inside your Gulpfile with this line of JavaScript:
```js
var melchior = require('gulp-melchior');
```
Melchior task
-------------
This is basic task to concatenate all files in Melchior project
```js
gulp.task('melchior', function(){
gulp.src('config.js')
.pipe(melchior())
.pipe(gulp.dest('build'));
});
```
Options
-------
`melchior` plugin can be initialized with options object. In example:
```js
.pipe(melchior({
path: 'folder/'
}));
```
path: String
____________
This option is used when file with Melchior config isn't in the same folder as Gulp(this is normal).
Folder structure:
```
├──gulpfile.js
└──app
├──js
│ ├──config.js
│ ├──app.js
│ └──module.js
├──html
└──css
```
MelchiorJS config:
```js
melchiorjs.config({
paths: {
'module': 'js/module.js'
}
});
```
Gulp Task example:
```js
gulp.task('melchior', function(){
gulp.src('app/js/config.js')
.pipe(melchior({
path: 'app/'
}))
.pipe(gulp.dest('build'));
});
```
*Please end `path` with correct path delimeter character.*
Concatenation of non-local files
--------------------------------
Right now non-local files don't concatenated in result file.