Only transform this/use strict if a module.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { basename, extname } from "path";
|
||||
import template from "babel-template";
|
||||
import {
|
||||
isModule,
|
||||
rewriteModuleStatementsAndPrepareHeader,
|
||||
hasExports,
|
||||
isSideEffectImport,
|
||||
@@ -107,6 +108,8 @@ export default function({ types: t }) {
|
||||
visitor: {
|
||||
Program: {
|
||||
exit(path, state) {
|
||||
if (!isModule(path)) return;
|
||||
|
||||
const {
|
||||
globals,
|
||||
exactGlobals,
|
||||
|
||||
Reference in New Issue
Block a user