Merge pull request #6280 from loganfsmyth/only-transform-modules
Only transform 'this'->'undefined' and inject 'use strict' if module statements are present
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import template from "babel-template";
|
||||
import {
|
||||
isModule,
|
||||
rewriteModuleStatementsAndPrepareHeader,
|
||||
hasExports,
|
||||
isSideEffectImport,
|
||||
@@ -18,6 +19,8 @@ export default function({ types: t }) {
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path, state) {
|
||||
if (!isModule(path)) return;
|
||||
|
||||
const {
|
||||
loose,
|
||||
allowTopLevelThis,
|
||||
|
||||
Reference in New Issue
Block a user