-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gulp-task-build-js-rollup): add corejs options
- Loading branch information
Showing
9 changed files
with
265 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
packages/gulp-task-build-js-rollup/test/fixtures/expected/main.corejs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
/** | ||
* @license | ||
* | ||
* @hidoo/gulp-task-build-js-rollup: | ||
* author: hidoo | ||
* version: 0.8.2 | ||
*/ | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
function _classCallCheck(instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
} | ||
|
||
function _defineProperties(target, props) { | ||
for (var i = 0; i < props.length; i++) { | ||
var descriptor = props[i]; | ||
descriptor.enumerable = descriptor.enumerable || false; | ||
descriptor.configurable = true; | ||
if ("value" in descriptor) descriptor.writable = true; | ||
Object.defineProperty(target, descriptor.key, descriptor); | ||
} | ||
} | ||
|
||
function _createClass(Constructor, protoProps, staticProps) { | ||
if (protoProps) _defineProperties(Constructor.prototype, protoProps); | ||
if (staticProps) _defineProperties(Constructor, staticProps); | ||
return Constructor; | ||
} | ||
|
||
function _inherits(subClass, superClass) { | ||
if (typeof superClass !== "function" && superClass !== null) { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
|
||
subClass.prototype = Object.create(superClass && superClass.prototype, { | ||
constructor: { | ||
value: subClass, | ||
writable: true, | ||
configurable: true | ||
} | ||
}); | ||
if (superClass) _setPrototypeOf(subClass, superClass); | ||
} | ||
|
||
function _getPrototypeOf(o) { | ||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { | ||
return o.__proto__ || Object.getPrototypeOf(o); | ||
}; | ||
return _getPrototypeOf(o); | ||
} | ||
|
||
function _setPrototypeOf(o, p) { | ||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { | ||
o.__proto__ = p; | ||
return o; | ||
}; | ||
|
||
return _setPrototypeOf(o, p); | ||
} | ||
|
||
function _assertThisInitialized(self) { | ||
if (self === void 0) { | ||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | ||
} | ||
|
||
return self; | ||
} | ||
|
||
function _possibleConstructorReturn(self, call) { | ||
if (call && (typeof call === "object" || typeof call === "function")) { | ||
return call; | ||
} | ||
|
||
return _assertThisInitialized(self); | ||
} | ||
|
||
/** | ||
* ESModules 形式のモジュール | ||
* @return {void} | ||
*/ | ||
function esModule() { | ||
// eslint-disable-next-line no-console | ||
console.log('This is ES Module.'); | ||
} | ||
|
||
// eslint-disable-next-line strict | ||
/** | ||
* Common JS 形式のモジュール | ||
* @return {void} | ||
*/ | ||
|
||
var cjs = function commonJsModule() { | ||
// eslint-disable-next-line no-console | ||
console.log('This is Common JS Module.'); | ||
}; | ||
|
||
esModule(); | ||
cjs(); | ||
|
||
var Es2015Class = | ||
/*#__PURE__*/ | ||
function () { | ||
function Es2015Class() { | ||
_classCallCheck(this, Es2015Class); | ||
|
||
this.name = 'es2015-class'; | ||
} | ||
|
||
_createClass(Es2015Class, [{ | ||
key: "print", | ||
value: function print() { | ||
console.log(this.name); // eslint-disable-line no-console | ||
} | ||
}]); | ||
|
||
return Es2015Class; | ||
}(); | ||
|
||
var ChildEs2015Class = | ||
/*#__PURE__*/ | ||
function (_Es2015Class) { | ||
_inherits(ChildEs2015Class, _Es2015Class); | ||
|
||
function ChildEs2015Class() { | ||
var _this; | ||
|
||
_classCallCheck(this, ChildEs2015Class); | ||
|
||
_this = _possibleConstructorReturn(this, _getPrototypeOf(ChildEs2015Class).call(this)); | ||
_this.name = 'child-es2015-class'; | ||
return _this; | ||
} | ||
|
||
return ChildEs2015Class; | ||
}(Es2015Class); | ||
|
||
var child = new ChildEs2015Class(); | ||
child.print(); | ||
|
||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/gulp-task-build-js-rollup/test/fixtures/expected/main.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+158 Bytes
(100%)
packages/gulp-task-build-js-rollup/test/fixtures/expected/main.min.js.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters