diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap index bf84aff19..b22ca1632 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap @@ -184,7 +184,8 @@ exports[`javascript configuration for android 1`] = ` { test: /\\\\.js$/, exclude: [ - /node_modules/ + /node_modules/, + '__jest__/src/app.js' ], use: [ /* config.module.rule('hmr-core').use('nativescript-hot-loader') */ @@ -503,7 +504,8 @@ exports[`javascript configuration for ios 1`] = ` { test: /\\\\.js$/, exclude: [ - /node_modules/ + /node_modules/, + '__jest__/src/app.js' ], use: [ /* config.module.rule('hmr-core').use('nativescript-hot-loader') */ diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap index e1b8dc786..424cf8a59 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap @@ -184,7 +184,8 @@ exports[`typescript configuration for android 1`] = ` { test: /\\\\.(js|ts)$/, exclude: [ - /node_modules/ + /node_modules/, + '__jest__/src/app.js' ], use: [ /* config.module.rule('hmr-core').use('nativescript-hot-loader') */ @@ -503,7 +504,8 @@ exports[`typescript configuration for ios 1`] = ` { test: /\\\\.(js|ts)$/, exclude: [ - /node_modules/ + /node_modules/, + '__jest__/src/app.js' ], use: [ /* config.module.rule('hmr-core').use('nativescript-hot-loader') */ diff --git a/packages/webpack5/src/configuration/javascript.ts b/packages/webpack5/src/configuration/javascript.ts index 53f7a0cd5..7dccca1a1 100644 --- a/packages/webpack5/src/configuration/javascript.ts +++ b/packages/webpack5/src/configuration/javascript.ts @@ -1,13 +1,13 @@ import Config from 'webpack-chain'; +import { getEntryPath, getEntryDirPath } from "../helpers/platform"; import { addVirtualEntry } from '../helpers/virtualModules'; -import { getEntryDirPath } from "../helpers/platform"; import { env as _env, IWebpackEnv } from '../index'; import base from './base'; export default function (config: Config, env: IWebpackEnv = _env): Config { base(config, env); - + const entryPath = getEntryPath(); const filterRE = '/.(xml|js|s?css)$/'; const virtualEntryPath = addVirtualEntry( config, @@ -38,6 +38,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config { .test(/\.js$/) .exclude .add(/node_modules/) + .add(entryPath) .end() .use('nativescript-hot-loader') .loader('nativescript-hot-loader') diff --git a/packages/webpack5/src/configuration/typescript.ts b/packages/webpack5/src/configuration/typescript.ts index de0c28d9f..0e31692ad 100644 --- a/packages/webpack5/src/configuration/typescript.ts +++ b/packages/webpack5/src/configuration/typescript.ts @@ -1,13 +1,13 @@ import Config from 'webpack-chain'; +import { getEntryDirPath, getEntryPath } from "../helpers/platform"; import { addVirtualEntry } from '../helpers/virtualModules'; -import { getEntryDirPath } from "../helpers/platform"; import { env as _env, IWebpackEnv } from '../index'; import base from './base'; export default function (config: Config, env: IWebpackEnv = _env): Config { base(config, env); - + const entryPath = getEntryPath(); const filterRE = '/.(xml|js|ts|s?css)$/'; const virtualEntryPath = addVirtualEntry( config, @@ -38,6 +38,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config { .test(/\.(js|ts)$/) .exclude .add(/node_modules/) + .add(entryPath) .end() .use('nativescript-hot-loader') .loader('nativescript-hot-loader')