allow splittable user to use additional plugins in the deps finding pipeline#51
allow splittable user to use additional plugins in the deps finding pipeline#51erwinmombay wants to merge 3 commits intocramforce:masterfrom
Conversation
1f331d8 to
0fccb03
Compare
…ipeline this is needed as there are some constructs that the jison library generates that blows up with "use strict" directive. I need to be able to pass "transform-remove-strict-mode" plugin
splittable.js
Outdated
| transform(babel, { | ||
| babelrc: false, | ||
| plugins: [ | ||
| plugins: Array.isArray(config.babel.plugins) ? config.babel.plugins.concat([ |
There was a problem hiding this comment.
Should this be a new config option or the same as above?
There was a problem hiding this comment.
ideally i think it should be a different one. since the presets list used in the transform phase could be different in the deps finding phase.
There was a problem hiding this comment.
should we allow for 2 babel configs or should a hacky config.babel.depSearchPhasePlugins do?
There was a problem hiding this comment.
Can we maybe make the plugin you need default?
There was a problem hiding this comment.
ideally it shouldn't since the "use strict" directive is desirable after all (correct me if im wrong), its just unfortunate that jison uses a lot of labels and jumps
|
Its fine. We really just discover deps here. Should be less strict than
closure compiler.
…On Mon, Sep 25, 2017 at 10:29 AM, erwin mombay ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In splittable.js
<#51 (comment)>:
> @@ -238,9 +238,10 @@ exports.getGraph = function(entryModules, config) {
// directly and which we don't want to apply during deps finding.
transform(babel, {
babelrc: false,
- plugins: [
+ plugins: Array.isArray(config.babel.plugins) ? config.babel.plugins.concat([
ideally it shouldn't since the "use strict" directive is desirable after
all (correct me if im wrong), its just unfortunate that jison uses a lot of
labels and jumps
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAFeT2w7BtBu7aUZmvflag7PXof-CLYCks5sl-MQgaJpZM4PikFV>
.
|
|
@cramforce ah right. that makes sense. ill make the changes and move the export babel plugin back into the splittable repo |
| visitor: { | ||
| Program(path, state) { | ||
| const id = path.scope.generateUidIdentifier('uid') | ||
| const constNumDecl = t.variableDeclaration('const', [ |
There was a problem hiding this comment.
@jridgewell is this the right way to add export someModuleUniqueId = 42;? would appreciate advice
There was a problem hiding this comment.
Almost. Drop the t.exportSpecifier:
export default function (babel) {
const { types: t } = babel;
return {
visitor: {
Program(path) {
const uid = path.scope.generateUidIdentifier('uid');
const declar = t.variableDeclaration('const', [
t.variableDeclarator(uid, t.numericLiteral(42)),
]);
const ex = t.exportNamedDeclaration(declar, []);
path.unshiftContainer("body", ex);
}
}
};
}
this is needed as there are some constructs that the jison library
generates that blows up with "use strict" directive. I need to be able
to pass "transform-remove-strict-mode" plugin