UNPKG

467 BJavaScriptView Raw
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
8'use strict';
9
10const path = require('path');
11const escape = require('escape-string-regexp');
12
13module.exports = function ignoredFiles(appSrc) {
14 return new RegExp(
15 `^(?!${escape(
16 path.normalize(appSrc + '/').replace(/[\\]+/g, '/')
17 )}).+/node_modules/`,
18 'g'
19 );
20};