mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
fix(android): prevent error on navigation back after using page transition (#10439)
This commit is contained in:
@ -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
|
||||
|
@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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]);
|
||||
|
Reference in New Issue
Block a user