MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / applyCopyRules

Function applyCopyRules

packages/webpack5/src/helpers/copyRules.ts:53–92  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

51 * @internal
52 */
53export function applyCopyRules(config: Config) {
54 const entryDir = getEntryDirPath();
55 const globOptions = {
56 dot: false,
57 ignore: [],
58 };
59
60 // todo: do we need to handle empty appResourcesPath?
61 // (the CLI should always pass the path - maybe not required)
62 if (env.appResourcesPath) {
63 const appResourcesFolderName = basename(env.appResourcesPath);
64
65 // ignore everything in App_Resources (regardless where they are located)
66 globOptions.ignore.push(`**/${appResourcesFolderName}/**`);
67 }
68
69 config.plugin('CopyWebpackPlugin').use(CopyWebpackPlugin, [
70 {
71 patterns: Array.from(copyRules)
72 // reverted: removes valid rules occasionally (ie fonts)
73 // todo: re-visit in future...
74 // .filter((glob) => {
75 // if (process.env.NODE_ENV === 'test') {
76 // return true;
77 // }
78 // // remove rules that do not match any paths
79 // // prevents webpack watch mode from firing
80 // // due to "removed" paths.
81 // return globbySync(glob).length > 0;
82 // })
83 .map((glob) => ({
84 from: glob,
85 context: entryDir,
86 noErrorOnMissing: true,
87 globOptions,
88 }))
89 .concat(additionalCopyRules),
90 },
91 ]);
92}

Callers 1

base.tsFile · 0.90

Calls 4

getEntryDirPathFunction · 0.90
concatMethod · 0.80
mapMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected