add more plugins, rename some
This commit is contained in:
20
packages/babel-plugin-transform-jscript/src/index.js
Normal file
20
packages/babel-plugin-transform-jscript/src/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
export default function ({ types: t }) {
|
||||
return {
|
||||
visitor: {
|
||||
FunctionExpression: {
|
||||
exit(node) {
|
||||
if (!node.id) return;
|
||||
node._ignoreUserWhitespace = true;
|
||||
|
||||
return t.callExpression(
|
||||
t.functionExpression(null, [], t.blockStatement([
|
||||
t.toStatement(node),
|
||||
t.returnStatement(node.id)
|
||||
])),
|
||||
[]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user