| 166 | } |
| 167 | |
| 168 | async function copyWebDir(config: Config, nativeAbsDir: string, webAbsDir: string) { |
| 169 | const webRelDir = basename(webAbsDir); |
| 170 | const nativeRelDir = relative(config.app.rootDir, nativeAbsDir); |
| 171 | |
| 172 | if (config.app.extConfig.server?.url && !(await pathExists(webAbsDir))) { |
| 173 | logger.warn( |
| 174 | `Cannot copy web assets from ${c.strong(webRelDir)} to ${nativeRelDir}\n` + |
| 175 | `Web asset directory specified by ${c.input('webDir')} does not exist. This is not an error because ${c.input( |
| 176 | 'server.url', |
| 177 | )} is set in config.`, |
| 178 | ); |
| 179 | |
| 180 | return; |
| 181 | } |
| 182 | |
| 183 | await runTask(`Copying web assets from ${c.strong(webRelDir)} to ${nativeRelDir}`, async () => { |
| 184 | await remove(nativeAbsDir); |
| 185 | return fsCopy(webAbsDir, nativeAbsDir); |
| 186 | }); |
| 187 | } |
| 188 | |
| 189 | async function copyFederatedWebDirs(config: Config, nativeAbsDir: string) { |
| 190 | logger.info('FederatedCapacitor Plugin Loaded - Copying Web Assets'); |