Skip to content

Commit

Permalink
Add '--resetCache' option
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Elliott committed Oct 25, 2015
1 parent fde7f9b commit dda04b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bin/rnws.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ function commonOptions(program) {
'-e, --entry [name]',
'Webpack entry module. [index.ios]',
'index.ios'
)
.option(
'-r, --resetCache',
'Remove cached react-native packager files [false]',
false
);
}

Expand Down
8 changes: 7 additions & 1 deletion lib/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class Server {
this.packagerPort = options.packagerPort || 8081;
this.webpackPort = options.webpackPort || 8082;
this.entry = options.entry || 'index.ios';
this.resetCache = (options.resetCache === true);
this.hot = (options.hot === true);
this.webpackConfig = options.webpackConfig;

Expand Down Expand Up @@ -242,7 +243,12 @@ class Server {
'./node_modules/react-native/packager/packager.js',
'--root', this.entryDir,
'--port', this.packagerPort,
];
].concat(
this.resetCache ?
'--resetCache' :
[]
);
console.log('args', args)
const opts = {stdio: 'inherit'};
this.packageServer = spawn(cmd, args, opts);

Expand Down

0 comments on commit dda04b8

Please sign in to comment.