mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-20 07:26:11 +08:00
fix: handle empty env for app resources
This commit is contained in:
@ -41,21 +41,23 @@ export function removeCopyRule(glob: string) {
|
||||
*/
|
||||
export function applyCopyRules(config: Config) {
|
||||
const entryDir = getEntryDirPath();
|
||||
// todo: handle empty appResourcesPath?
|
||||
// (the CLI should always pass the path - maybe not required)
|
||||
const appResourcesFullPath = resolve(
|
||||
getProjectRootPath(),
|
||||
env.appResourcesPath
|
||||
);
|
||||
|
||||
const globOptions = {
|
||||
dot: false,
|
||||
ignore: [
|
||||
// ignore everything in App_Resources (regardless where they are located)
|
||||
`${relative(entryDir, appResourcesFullPath)}/**`,
|
||||
],
|
||||
ignore: [],
|
||||
};
|
||||
|
||||
// todo: do we need to handle empty appResourcesPath?
|
||||
// (the CLI should always pass the path - maybe not required)
|
||||
if (env.appResourcesPath) {
|
||||
const appResourcesFullPath = resolve(
|
||||
getProjectRootPath(),
|
||||
env.appResourcesPath
|
||||
);
|
||||
|
||||
// ignore everything in App_Resources (regardless where they are located)
|
||||
globOptions.ignore.push(`${relative(entryDir, appResourcesFullPath)}/**`);
|
||||
}
|
||||
|
||||
config.plugin('CopyWebpackPlugin').use(CopyWebpackPlugin, [
|
||||
{
|
||||
patterns: Array.from(copyRules).map((glob) => ({
|
||||
|
||||
Reference in New Issue
Block a user