Only transform this/use strict if a module.

This commit is contained in:
Logan Smyth
2017-09-14 17:36:25 -07:00
parent 8e6b5de042
commit 2b88e079ef
27 changed files with 46 additions and 58 deletions

View File

@@ -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,