Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packager/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
*/
'use strict';

var path = require("path"); // used for path separator

// Don't forget to everything listed here to `testConfig.json`
// modulePathIgnorePatterns.
var sharedBlacklist = [
__dirname,
'website',
'/.git', // added because nodeWatcher does not ignore hidden files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recently fixed this error in sane -- the file watcher.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it's fine to keep

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, also noticed you fixed the NodeWatcher creation to pass an object with glob as a field, which seem to fix an issue where the glob pattern was being ignored.

'node_modules/react-tools/src/utils/ImmutableObject.js',
'node_modules/react-tools/src/core/ReactInstanceHandles.js',
'node_modules/react-tools/src/event/EventPropagators.js'
Expand Down Expand Up @@ -40,7 +43,9 @@ var platformBlacklists = {
};

function escapeRegExp(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
var escaped = str.replace(/[\-\[\]\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
// convert the '/' into an escaped local file separator
return escaped.replace(/\//g,"\\"+path.sep);
}

function blacklist(platform, additionalBlacklist) {
Expand Down
8 changes: 5 additions & 3 deletions packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ if (options.projectRoots) {
options.projectRoots = options.projectRoots.split(',');
}
} else {
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
// packager is running from node_modules of another project
// match on either path separator
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]packager$/)) {
// packager is running from node_modules of another project
options.projectRoots = [path.resolve(__dirname, '../../..')];
} else {
options.projectRoots = [path.resolve(__dirname, '..')];
Expand All @@ -79,7 +80,8 @@ if (options.assetRoots) {
options.assetRoots = options.assetRoots.split(',');
}
} else {
if (__dirname.match(/node_modules\/react-native\/packager$/)) {
// match on either path separator
if (__dirname.match(/node_modules[\/\\]react-native[\/\\]packager$/)) {
options.assetRoots = [path.resolve(__dirname, '../../..')];
} else {
options.assetRoots = [path.resolve(__dirname, '..')];
Expand Down