-
Notifications
You must be signed in to change notification settings - Fork 34
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
allow splittable user to use additional plugins in the deps finding pipeline #51
base: master
Are you sure you want to change the base?
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
@@ -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([ |
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.
Should this be a new config option or the same as above?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets rename then.
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.
should we allow for 2 babel configs or should a hacky config.babel.depSearchPhasePlugins
do?
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.
Can we maybe make the plugin you need default?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jridgewell is this the right way to add export someModuleUniqueId = 42;
? would appreciate advice
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.
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