Skip to content

Commit 5b77ac1

Browse files
committed
fix .babelrc lookup when passing --path
1 parent cc80295 commit 5b77ac1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/after-prepare.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ module.exports = function (logger, platformsData, projectData, hookArgs) {
1212
sourceMaps: 'inline'
1313
};
1414

15-
if (fs.existsSync('.babelrc')) {
16-
babelOptions = JSON.parse(fs.readFileSync('.babelrc'));
15+
var babelrcFilePath = path.join(projectData.projectDir, '.babelrc');
16+
if (fs.existsSync(babelrcFilePath)) {
17+
babelOptions = JSON.parse(fs.readFileSync(babelrcFilePath));
1718
} else {
1819
var packageOpts = JSON.parse(fs.readFileSync(path.join(projectData.projectDir, 'package.json')));
1920
if (packageOpts.babel) {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-dev-babel",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)