parent
c01a5d22d4
commit
6868e4aa59
|
@ -29,6 +29,19 @@ module.exports = ({ types: t }) => ({
|
|||
)
|
||||
)
|
||||
),
|
||||
t.expressionStatement(
|
||||
t.callExpression(
|
||||
t.memberExpression(
|
||||
t.identifier('Object'), t.identifier('defineProperty')),
|
||||
[
|
||||
t.identifier('exports'),
|
||||
t.stringLiteral('__esModule'),
|
||||
t.objectExpression([
|
||||
t.objectProperty(t.identifier('value'), t.booleanLiteral(true))
|
||||
])
|
||||
]
|
||||
)
|
||||
),
|
||||
t.expressionStatement(
|
||||
t.assignmentExpression('=',
|
||||
expr.node.left, t.identifier('exports')
|
||||
|
|
|
@ -7,6 +7,7 @@ export default function tweakDefault() {
|
|||
var matches = /^(exports(?:\['default']|\.default)) = (.*);$/.exec(line);
|
||||
if (matches) {
|
||||
lines[i] = 'module.exports = exports = ' + matches[2] + ';\n' +
|
||||
'Object.defineProperty(exports, "__esModule", { value: true });\n' +
|
||||
matches[1] + ' = exports;';
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue