Skip to content

Commit

Permalink
build: use + for ES6 template literals
Browse files Browse the repository at this point in the history
The behavior before is `"".concat(part1, part2, ...)`,
which is useless and makes the minified file larger (about 600 bytes).

The benefit of `concat` is just supporting `Symbol.toPrimitive`.
Therefore, we should replace it with simpler `+`.

Doc:
* https://babeljs.io/docs/en/babel-plugin-transform-template-literals
* babel/babel#5791
  • Loading branch information
gdh1995 committed Jun 4, 2019
1 parent d196464 commit 633608f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Expand Up @@ -7,6 +7,11 @@
}
]
],
"plugins": [
["@babel/plugin-transform-template-literals", {
"loose": true
}]
],
"env": {
"test": {
"plugins": [
Expand Down

0 comments on commit 633608f

Please sign in to comment.