diff --git a/README.md b/README.md index 7b9f8b2..c4150df 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ monic.compile( { replacers: [ // Replaces require to #include + // ("this" refers to the instance of the compiler) function (text, file) { return text.replace(/^\s*require\('(.*?)'\);/gm, '//#include $1'); } diff --git a/README.ru.md b/README.ru.md index ed5aad6..2626489 100644 --- a/README.ru.md +++ b/README.ru.md @@ -204,6 +204,7 @@ monic.compile( { replacers: [ // Замена require конструкций на #include + // (this ссылается на экземпляр сборщика) function (text, file) { return text.replace(/^\s*require\('(.*?)'\);/gm, '//#include $1'); } diff --git a/dist/file.js b/dist/file.js index 3611733..f6ae73e 100644 --- a/dist/file.js +++ b/dist/file.js @@ -1,11 +1,11 @@ /*! - * Monic v2.3.3 + * Monic v2.3.4 * https://github.com/MonicBuilder/Monic * * Released under the MIT license * https://github.com/MonicBuilder/Monic/blob/master/LICENSE * - * Date: Sun, 23 Aug 2015 13:08:15 GMT + * Date: Sat, 05 Sep 2015 13:08:56 GMT */ 'use strict'; diff --git a/dist/parser.js b/dist/parser.js index 0065180..108b8a0 100644 --- a/dist/parser.js +++ b/dist/parser.js @@ -1,11 +1,11 @@ /*! - * Monic v2.3.3 + * Monic v2.3.4 * https://github.com/MonicBuilder/Monic * * Released under the MIT license * https://github.com/MonicBuilder/Monic/blob/master/LICENSE * - * Date: Sun, 23 Aug 2015 13:08:15 GMT + * Date: Sat, 05 Sep 2015 13:08:56 GMT */ 'use strict'; @@ -31,10 +31,6 @@ var _glob = require('glob'); var _glob2 = _interopRequireDefault(_glob); -var _objectAssign = require('object-assign'); - -var _objectAssign2 = _interopRequireDefault(_objectAssign); - var _path = require('path'); var path = _interopRequireWildcard(_path); @@ -79,7 +75,7 @@ var Parser = (function () { this.eol = eol; this.replacers = replacers; - this.flags = _objectAssign2['default']({}, flags); + this.flags = _collectionJs.$C.extend(false, {}, flags); this.sourceMaps = sourceMaps; this.inputSourceMap = inputSourceMap; this.sourceRoot = sourceRoot; diff --git a/monic.js b/monic.js index 514fad0..6a23c45 100644 --- a/monic.js +++ b/monic.js @@ -17,11 +17,13 @@ const async = require('async'), mkdirp = require('mkdirp'), ok = require('okay'), - promisify = require('promisify-any'), - assign = require('object-assign'); + promisify = require('promisify-any'); + +const + $C = require('collection.js').$C; /** @type {!Array} */ -exports.VERSION = [2, 3, 3]; +exports.VERSION = [2, 3, 4]; /** * Builds a file @@ -54,7 +56,7 @@ exports.compile = function (file, opt_params, opt_callback) { function compile(file, params, callback) { file = url(file); - params = assign({ + params = $C.extend(false, { flags: {}, labels: {}, eol: '\n', diff --git a/package.json b/package.json index 3a67b35..2ffa281 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "File builder for JavaScript.", "homepage": "https://github.com/MonicBuilder/Monic", "main": "monic.js", - "version": "2.3.3", + "version": "2.3.4", "license": "MIT", "author": { "name": "kobezzza", @@ -43,7 +43,6 @@ "commander": "^2.5.0", "glob": "^5.0.5", "mkdirp": "^0.5.0", - "object-assign": "^4.0.1", "okay": "^1.0.0", "promisify-any": "^1.1.1", "source-map": "^0.4.2", diff --git a/src/parser.js b/src/parser.js index 16f256b..677de37 100644 --- a/src/parser.js +++ b/src/parser.js @@ -8,7 +8,6 @@ import ok from 'okay'; import glob from 'glob'; -import assign from 'object-assign'; import * as path from 'path'; import * as fs from 'fs'; @@ -33,7 +32,7 @@ export default class Parser { constructor({eol, replacers, flags, sourceMaps, sourceRoot, inputSourceMap}) { this.eol = eol; this.replacers = replacers; - this.flags = assign({}, flags); + this.flags = $C.extend(false, {}, flags); this.sourceMaps = sourceMaps; this.inputSourceMap = inputSourceMap; this.sourceRoot = sourceRoot;