Skip to content

Commit

Permalink
feat: webpack 使用 loader 配置 Babel
Browse files Browse the repository at this point in the history
  • Loading branch information
yangjin committed Dec 2, 2019
1 parent c98fb2d commit bdfbb81
Show file tree
Hide file tree
Showing 6 changed files with 1,053 additions and 12 deletions.
5 changes: 5 additions & 0 deletions demo/webpack-demo/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"babel-preset-env"
]
}
4 changes: 1 addition & 3 deletions demo/webpack-demo/app/sum.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
module.exports = function(a, b) {
return a + b
}
module.exports = (a, b) => a + b;
17 changes: 12 additions & 5 deletions demo/webpack-demo/build/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,23 @@
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var sum = __webpack_require__(1);
console.log(sum(1, 2))

console.log(sum(1, 2));

/***/ }),
/* 1 */
/***/ (function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function(a, b) {
return a + b
}
module.exports = function (a, b) {
return a + b;
};

/***/ })
/******/ ]);
Loading

0 comments on commit bdfbb81

Please sign in to comment.