Skip to content

Commit 0457275

Browse files
committed
add blacklist env
1 parent 68e74de commit 0457275

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rn-packager",
3-
"version": "0.9.5",
3+
"version": "0.9.6",
44
"description": "Based on Facebook Packager v0.32.0, support Core & Business JS Separate.",
55
"main": "src/index.js",
66
"bin": {
@@ -17,6 +17,9 @@
1717
"bugs": {
1818
"url": "https://github.com/react-component/rn-packager/issues"
1919
},
20+
"scripts": {
21+
"publish": "git push origin"
22+
},
2023
"dependencies": {
2124
"absolute-path": "^0.0.0",
2225
"art": "^0.10.0",

react-native/packager/react-packager/src/Resolver/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ let rnBlackList = [];
2020
let rnSimpleBL = [];
2121
let rnRegExpBL = [];
2222

23-
const blparts = __dirname.split('node_modules');
24-
let projectRoot = blparts[0];
25-
if (blparts.length < 2) {
26-
projectRoot = process.cwd();
27-
}
28-
const blacklistPath = path.join(projectRoot, 'rn-blacklist.js');
29-
if (fs.existsSync(blacklistPath)) {
30-
rnBlackList = require(blacklistPath);
23+
if(process.env.RN_BLACKLIST_PATH){
24+
rnBlackList = require(process.env.RN_BLACKLIST_PATH);
25+
} else if (fs.existsSync(path.join(process.cwd(), 'rn-blacklist.js'))) {
26+
rnBlackList = require(process.cwd() + '/rn-blacklist.js');
3127
}
3228

3329
for (var i in rnBlackList) {

0 commit comments

Comments
 (0)