Comparing version 0.1.1 to 0.1.2
@@ -8,3 +8,3 @@ "use strict"; | ||
const context = { | ||
ast: acorn_1.parse(code, { ecmaVersion: 'latest' }), | ||
ast: acorn_1.parse(code, { ecmaVersion: 'latest', sourceType: 'module' }), | ||
code, | ||
@@ -11,0 +11,0 @@ sourcemap: null, |
@@ -8,5 +8,5 @@ "use strict"; | ||
function transform(code, options = {}) { | ||
const context = context_1.createContext({ code }); | ||
const analyze = analyze_1.createAnalyze(context); | ||
try { | ||
const context = context_1.createContext({ code }); | ||
const analyze = analyze_1.createAnalyze(context); | ||
analyze.analyze(); | ||
@@ -17,2 +17,7 @@ transform_1.createTransform(context, { | ||
}).transform(); | ||
return { | ||
code: context.transformedCode, | ||
sourcemap: context.sourcemap, | ||
context, | ||
}; | ||
} | ||
@@ -22,8 +27,3 @@ catch (error) { | ||
} | ||
return { | ||
code: context.transformedCode, | ||
sourcemap: context.sourcemap, | ||
context, | ||
}; | ||
} | ||
exports.transform = transform; |
{ | ||
"name": "cjs-esm", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Another CommonJs transform ESModule lib.", | ||
@@ -11,3 +11,3 @@ "main": "dist/index.js", | ||
"dev": "tsc --watch", | ||
"build": "tsc" | ||
"build": "rm -rf dist && tsc" | ||
}, | ||
@@ -14,0 +14,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22382