ignoredFiles.js 467 B

1234567891011121314151617181920
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. 'use strict';
  8. const path = require('path');
  9. const escape = require('escape-string-regexp');
  10. module.exports = function ignoredFiles(appSrc) {
  11. return new RegExp(
  12. `^(?!${escape(
  13. path.normalize(appSrc + '/').replace(/[\\]+/g, '/')
  14. )}).+/node_modules/`,
  15. 'g'
  16. );
  17. };