mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: working with builder xml require vs dynamic import wip
This commit is contained in:
@@ -526,6 +526,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
||||
__CSS_PARSER__: JSON.stringify(getValue('cssParser', 'css-tree')),
|
||||
__UI_USE_XML_PARSER__: true,
|
||||
__UI_USE_EXTERNAL_RENDERER__: false,
|
||||
__COMMONJS__: !!env.commonjs,
|
||||
__ANDROID__: platform === 'android',
|
||||
__IOS__: platform === 'ios',
|
||||
__VISIONOS__: platform === 'visionos',
|
||||
|
||||
@@ -50,6 +50,9 @@ export interface IWebpackEnv {
|
||||
// print webpack stats (default: true)
|
||||
stats?: boolean;
|
||||
|
||||
// enable commonjs modules (default: ES modules, esm)
|
||||
commonjs?: boolean;
|
||||
|
||||
// misc
|
||||
replace?: string[] | string;
|
||||
watchNodeModules?: boolean;
|
||||
@@ -158,10 +161,9 @@ export function chainWebpack(
|
||||
* @param mergeFn An object or a function that optionally returns an object (can mutate the object directly and return nothing)
|
||||
*/
|
||||
export function mergeWebpack(
|
||||
mergeFn: ((
|
||||
config: Partial<webpack.Configuration>,
|
||||
env: IWebpackEnv,
|
||||
) => any) | Partial<webpack.Configuration>,
|
||||
mergeFn:
|
||||
| ((config: Partial<webpack.Configuration>, env: IWebpackEnv) => any)
|
||||
| Partial<webpack.Configuration>,
|
||||
) {
|
||||
webpackMerges.push(mergeFn);
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@ export default function loader(content: string, map: any) {
|
||||
|
||||
const relativePath = relative(
|
||||
opts.appPath ?? this.rootContext,
|
||||
this.resourcePath
|
||||
this.resourcePath,
|
||||
).replace(/\\/g, '/');
|
||||
|
||||
const hmrCode = this.hot
|
||||
? dedent`
|
||||
/* NATIVESCRIPT-HOT-LOADER */
|
||||
if(module.hot && global._isModuleLoadedForUI && global._isModuleLoadedForUI("./${relativePath}")) {
|
||||
if(module.hot) {
|
||||
module.hot.accept()
|
||||
}
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user