@smpx/babel-changed
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -112,3 +112,3 @@ const babel = require('@babel/core'); | ||
await fs.unlink(destFile).catch((err) => { | ||
logger.warn('A file could not be removed,', destFile, err.message) | ||
logger.warn('[babel] A file could not be removed,', destFile, err.message) | ||
}); | ||
@@ -131,3 +131,4 @@ }); | ||
await pMap(filesToCompile, async (srcFile) => { | ||
const destFile = `${destDir}${srcFile.substring(srcDir.length)}`; | ||
let destFile = `${destDir}${srcFile.substring(srcDir.length)}`; | ||
destFile = `${destFile.slice(0, destFile.length - path.extname(destFile).length)}.js`; | ||
const result = await babel.transformFileAsync(srcFile, options); | ||
@@ -134,0 +135,0 @@ |
{ | ||
"name": "@smpx/babel-changed", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Only compile changed files with babel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -66,1 +66,11 @@ # babel-changed | ||
``` | ||
### Extensions/Typescript support | ||
For compiling TS/JSX files with babel, change the extensions to compile like below: | ||
```sh | ||
babel-changed -e ".js,.ts" | ||
``` | ||
**NOTE**: Extension of compiled file will always be `.js`. |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9384
162
76
0