diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap index be68af978..8ad46eb11 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap @@ -219,9 +219,7 @@ exports[`angular configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -230,9 +228,7 @@ exports[`angular configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -241,9 +237,7 @@ exports[`angular configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -490,9 +484,7 @@ exports[`angular configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -501,9 +493,7 @@ exports[`angular configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -512,9 +502,7 @@ exports[`angular configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap index 497cd4df3..9a82e34e5 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap @@ -228,9 +228,7 @@ exports[`javascript configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -239,9 +237,7 @@ exports[`javascript configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -250,9 +246,7 @@ exports[`javascript configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -509,9 +503,7 @@ exports[`javascript configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -520,9 +512,7 @@ exports[`javascript configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -531,9 +521,7 @@ exports[`javascript configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap index 83ec5a46b..314368102 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap @@ -234,9 +234,7 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -245,9 +243,7 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -256,9 +252,7 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -510,9 +504,7 @@ exports[`react configuration > android > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -521,9 +513,7 @@ exports[`react configuration > android > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -532,9 +522,7 @@ exports[`react configuration > android > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -786,9 +774,7 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -797,9 +783,7 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -808,9 +792,7 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -1065,9 +1047,7 @@ exports[`react configuration > ios > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -1076,9 +1056,7 @@ exports[`react configuration > ios > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -1087,9 +1065,7 @@ exports[`react configuration > ios > base config 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap index 26b86976f..352ab3101 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap @@ -242,9 +242,7 @@ exports[`svelte configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -253,9 +251,7 @@ exports[`svelte configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -264,9 +260,7 @@ exports[`svelte configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -526,9 +520,7 @@ exports[`svelte configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -537,9 +529,7 @@ exports[`svelte configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -548,9 +538,7 @@ exports[`svelte configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap index 78fc59ba2..dda5b71fe 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap @@ -249,9 +249,7 @@ exports[`vue configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -260,9 +258,7 @@ exports[`vue configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -271,9 +267,7 @@ exports[`vue configuration for android 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] @@ -540,9 +534,7 @@ exports[`vue configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -551,9 +543,7 @@ exports[`vue configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } }, { @@ -562,9 +552,7 @@ exports[`vue configuration for ios 1`] = ` noErrorOnMissing: true, globOptions: { dot: false, - ignore: [ - '../**' - ] + ignore: [] } } ] diff --git a/packages/webpack5/__tests__/configuration/angular.spec.ts b/packages/webpack5/__tests__/configuration/angular.spec.ts index c8f16372a..879a7bd91 100644 --- a/packages/webpack5/__tests__/configuration/angular.spec.ts +++ b/packages/webpack5/__tests__/configuration/angular.spec.ts @@ -14,7 +14,7 @@ jest.mock( { virtual: true } ); -describe.only('angular configuration', () => { +describe('angular configuration', () => { const platforms = ['ios', 'android']; for (let platform of platforms) { diff --git a/packages/webpack5/__tests__/configuration/javascript.spec.ts b/packages/webpack5/__tests__/configuration/javascript.spec.ts index dcafbafc6..5222d0825 100644 --- a/packages/webpack5/__tests__/configuration/javascript.spec.ts +++ b/packages/webpack5/__tests__/configuration/javascript.spec.ts @@ -2,7 +2,7 @@ import Config from 'webpack-chain'; import javascript from '../../src/configuration/javascript'; import { init } from '../../src'; -describe.only('javascript configuration', () => { +describe('javascript configuration', () => { const platforms = ['ios', 'android']; for (let platform of platforms) { diff --git a/packages/webpack5/__tests__/configuration/svelte.spec.ts b/packages/webpack5/__tests__/configuration/svelte.spec.ts index b835cacba..3cac8e0df 100644 --- a/packages/webpack5/__tests__/configuration/svelte.spec.ts +++ b/packages/webpack5/__tests__/configuration/svelte.spec.ts @@ -7,7 +7,7 @@ mockFile('./svelte.config.js', ''); // jest.mock('__jest__/svelte.config.js', () => { // }, { virtual: true }) -describe.only('svelte configuration', () => { +describe('svelte configuration', () => { const platforms = ['ios', 'android']; for (let platform of platforms) { diff --git a/packages/webpack5/__tests__/configuration/vue.spec.ts b/packages/webpack5/__tests__/configuration/vue.spec.ts index ec6a626f5..b95e1c9b2 100644 --- a/packages/webpack5/__tests__/configuration/vue.spec.ts +++ b/packages/webpack5/__tests__/configuration/vue.spec.ts @@ -2,7 +2,7 @@ import Config from 'webpack-chain'; import vue from '../../src/configuration/vue'; import { init } from '../../src'; -describe.only('vue configuration', () => { +describe('vue configuration', () => { const platforms = ['ios', 'android']; for (let platform of platforms) { diff --git a/packages/webpack5/src/helpers/copyRules.ts b/packages/webpack5/src/helpers/copyRules.ts index a7cbdd242..6535e6fa8 100644 --- a/packages/webpack5/src/helpers/copyRules.ts +++ b/packages/webpack5/src/helpers/copyRules.ts @@ -41,21 +41,23 @@ export function removeCopyRule(glob: string) { */ export function applyCopyRules(config: Config) { const entryDir = getEntryDirPath(); - // todo: handle empty appResourcesPath? - // (the CLI should always pass the path - maybe not required) - const appResourcesFullPath = resolve( - getProjectRootPath(), - env.appResourcesPath - ); - const globOptions = { dot: false, - ignore: [ - // ignore everything in App_Resources (regardless where they are located) - `${relative(entryDir, appResourcesFullPath)}/**`, - ], + ignore: [], }; + // todo: do we need to handle empty appResourcesPath? + // (the CLI should always pass the path - maybe not required) + if (env.appResourcesPath) { + const appResourcesFullPath = resolve( + getProjectRootPath(), + env.appResourcesPath + ); + + // ignore everything in App_Resources (regardless where they are located) + globOptions.ignore.push(`${relative(entryDir, appResourcesFullPath)}/**`); + } + config.plugin('CopyWebpackPlugin').use(CopyWebpackPlugin, [ { patterns: Array.from(copyRules).map((glob) => ({