rollup-plugin-cjs-es
Advanced tools
Comparing version 0.3.0 to 0.3.1
30
index.js
@@ -9,3 +9,4 @@ const path = require("path"); | ||
const nodeResolve = promisify(require("resolve")); | ||
const {wrapImport, unwrapImport} = require("./lib/transform"); | ||
const {wrapImport} = require("./lib/wrap-import"); | ||
const {unwrapImport} = require("./lib/unwrap-import"); | ||
@@ -119,20 +120,13 @@ function joinMaps(maps) { | ||
if (options.splitCode) { | ||
let result; | ||
try { | ||
result = wrapImport({ | ||
code, | ||
parse, | ||
ast, | ||
shouldSplitCode: importee => { | ||
if (typeof options.splitCode === "function") { | ||
return options.splitCode(id, importee); | ||
} | ||
return false; | ||
const result = wrapImport({ | ||
code, | ||
parse, | ||
ast, | ||
shouldSplitCode: importee => { | ||
if (typeof options.splitCode === "function") { | ||
return options.splitCode(id, importee); | ||
} | ||
}); | ||
} catch (err) { | ||
const pos = err.node ? err.node.start : null; | ||
this.error(err, pos); | ||
return; | ||
} | ||
return false; | ||
} | ||
}); | ||
if (result.isTouched) { | ||
@@ -139,0 +133,0 @@ code = result.code; |
{ | ||
"name": "rollup-plugin-cjs-es", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Convert CommonJS module into ES module", | ||
@@ -17,3 +17,4 @@ "keywords": [ | ||
"scripts": { | ||
"test": "eslint **/*.js && mocha", | ||
"test": "eslint **/*.js && nyc --reporter=html mocha", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"preversion": "npm test", | ||
@@ -26,4 +27,6 @@ "postversion": "git push --follow-tags && npm publish" | ||
"devDependencies": { | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.19.1", | ||
"mocha": "^5.1.1", | ||
"nyc": "^11.7.1", | ||
"rollup": "^0.58.2" | ||
@@ -30,0 +33,0 @@ }, |
@@ -5,2 +5,3 @@ rollup-plugin-cjs-es | ||
[![Build Status](https://travis-ci.org/eight04/rollup-plugin-cjs-es.svg?branch=master)](https://travis-ci.org/eight04/rollup-plugin-cjs-es) | ||
[![Coverage Status](https://coveralls.io/repos/github/eight04/rollup-plugin-cjs-es/badge.svg?branch=master)](https://coveralls.io/github/eight04/rollup-plugin-cjs-es?branch=master) | ||
@@ -371,2 +372,6 @@ Convert CommonJS module into ES module. Powered by [cjs-es](https://github.com/eight04/cjs-es). | ||
* 0.3.1 (May 1, 2018) | ||
- Fix: scope is not correctly analyzed in splitCodeTransformer. | ||
* 0.3.0 (May 1, 2018) | ||
@@ -373,0 +378,0 @@ |
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
20705
6
303
395
5