fix(android): prevent error on navigation back after using page transition (#10439)

This commit is contained in:
farfromrefuge
2024-06-29 01:15:40 +02:00
committed by GitHub
parent 4abcb216da
commit 7036f12b5c
10 changed files with 59 additions and 44 deletions

View File

@ -12,7 +12,7 @@ interface IReplacementMap {
* @internal
*/
export function getFileReplacementsFromEnv(
env: IWebpackEnv = _env
env: IWebpackEnv = _env,
): IReplacementMap {
const fileReplacements: IReplacementMap = {};
@ -50,7 +50,7 @@ export function getFileReplacementsFromEnv(
export function applyFileReplacements(
config,
fileReplacements: IReplacementMap = getFileReplacementsFromEnv()
fileReplacements: IReplacementMap = getFileReplacementsFromEnv(),
) {
Object.entries(fileReplacements).forEach(([_replace, _with]) => {
// in case we are replacing source files - we'll use aliases

View File

@ -17,7 +17,7 @@ export function error(...data: any): Error {
// we return the error - the caller can throw or ignore
if (typeof data[0] === 'string') {
return new Error(
'\n\n[@nativescript/webpack]\n---\n\n' + dedent(data[0]) + '\n\n---\n'
'\n\n[@nativescript/webpack]\n---\n\n' + dedent(data[0]) + '\n\n---\n',
);
}

View File

@ -14,12 +14,12 @@ import { getProjectFilePath } from './project';
export function addVirtualEntry(
config: Config,
name: string,
contents: string
contents: string,
): string {
return addVirtualModule(
config,
`__@nativescript_webpack_virtual_entry_${name}__`,
contents
contents,
);
}
@ -29,7 +29,7 @@ export function addVirtualEntry(
export function addVirtualModule(
config: Config,
name: string,
contents: string
contents: string,
): string {
const virtualEntryPath = join(getEntryDirPath(), `${name}`);
@ -51,7 +51,7 @@ export function addVirtualModule(
// todo: we can remove this special handling once we no longer support v11
if (config.plugins.has('AngularCompilerPlugin')) {
const compatEntryPath = getProjectFilePath(
join('node_modules', '.nativescript', `${name}`)
join('node_modules', '.nativescript', `${name}`),
);
mkdirSync(dirname(compatEntryPath), { recursive: true });
writeFileSync(compatEntryPath, options[virtualEntryPath]);