-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(babel): use loose mode #33
Conversation
src/config/babelrc.js
Outdated
require.resolve('babel-plugin-transform-class-properties'), | ||
require.resolve('babel-plugin-transform-object-rest-spread'), | ||
require.resolve('babel-plugin-minify-dead-code-elimination'), | ||
!treeshake | ||
? require.resolve('babel-plugin-transform-es2015-modules-commonjs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules-commonjs also has a loose
mode, but i dont think its worth using as it breaks namespace imports
import * as namespace from './namespace'
in loose
namespace would have enumerable __esModule
property which can surprise quite a bit when spreading a namespace
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
==========================================
- Coverage 72.86% 72.78% -0.09%
==========================================
Files 21 21
Lines 328 327 -1
Branches 79 78 -1
==========================================
- Hits 239 238 -1
Misses 66 66
Partials 23 23
Continue to review full report at Codecov.
|
const envTargets = isTest | ||
? {node: 'current'} | ||
: isWebpack || isRollup ? {browsers: ['ie 10', 'ios 7']} : {node: '4.5'} | ||
const envOptions = Object.assign({}, envModules, {targets: envTargets}) | ||
const envOptions = {modules: false, loose: true, targets: envTargets} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... We only want {modules: false}
if treeshake
is true right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im adding transform-es2015-commonjs "by hand" few line below, please check out this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, I somehow missed that. Looks good!
…igin` (kentcdodds#33) * feat(transform): add support for `rotate` functions and `transform-origin` * fix(utils): add alias for `calculateNewTranslate` for backwards compatibility
fixes #32
What:
loose
mode for babel transformsWhy:
shorter, more optimized output code
Checklist: