feat(wepback): custom buildPathsupport (#10477)

Co-authored-by: farfromrefuge <dev@akylas.fr>
This commit is contained in:
Igor Randjelovic
2024-01-19 20:23:25 +01:00
committed by GitHub
parent ca886b9a1f
commit 429328495c
12 changed files with 26 additions and 19 deletions

View File

@ -1,9 +1,7 @@
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { basename, relative, resolve } from 'path';
import Config from 'webpack-chain';
import { sync as globbySync } from 'globby';
import { basename } from 'path';
import { getProjectRootPath } from './project';
import { getEntryDirPath } from './platform';
import { env } from '..';

View File

@ -1,8 +1,8 @@
import { resolve } from 'path';
import { env as _env, IWebpackEnv } from '../index';
import { addCopyRule } from './copyRules';
import { getProjectRootPath } from './project';
import { addCopyRule } from './copyRules';
interface IReplacementMap {
[_replace: string]: /* _with */ string;

View File

@ -10,6 +10,7 @@ import { applyFileReplacements } from './fileReplacements';
import { addCopyRule, removeCopyRule } from './copyRules';
import { error, info, warn, warnOnce } from './log';
import { determineProjectFlavor } from './flavor';
import { readTsConfig } from './typescript';
import { getValue } from './config';
import { getIPS } from './host';
import {
@ -26,7 +27,6 @@ import {
getPlatform,
getPlatformName,
} from './platform';
import { readTsConfig } from './typescript';
// intentionally populated manually
// as this generates nicer typings

View File

@ -1,5 +1,5 @@
import dedent from 'ts-dedent';
import { env } from '@nativescript/webpack';
import dedent from 'ts-dedent';
// de-indents strings so multi-line string literals can be used
function cleanup(data: any[]) {

View File

@ -138,7 +138,7 @@ export function getDistPath() {
}
// fallback to a generic platforms/<platform>/dist folder
return `platforms/${getPlatformName()}/dist`;
return `${env.buildPath ?? 'platforms'}/${getPlatformName()}/dist`;
}
/**

View File

@ -1,11 +1,11 @@
import { ContextExclusionPlugin } from 'webpack';
import Config from 'webpack-chain';
import { dirname, join } from 'path';
import { writeFileSync, mkdirSync } from 'fs';
import VirtualModulesPlugin from 'webpack-virtual-modules';
import { getEntryDirPath } from './platform';
import { ContextExclusionPlugin } from 'webpack';
import { mkdirSync, writeFileSync } from 'fs';
import { dirname, join } from 'path';
import Config from 'webpack-chain';
import dedent from 'ts-dedent';
import { getEntryDirPath } from './platform';
import { getProjectFilePath } from './project';
/**