mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
fix: handle empty env for app resources
This commit is contained in:

committed by
Nathan Walker

parent
84fdc11a8d
commit
d3e51bbd33
@ -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: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -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: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -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: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -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: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -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: []
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -14,7 +14,7 @@ jest.mock(
|
||||
{ virtual: true }
|
||||
);
|
||||
|
||||
describe.only('angular configuration', () => {
|
||||
describe('angular configuration', () => {
|
||||
const platforms = ['ios', 'android'];
|
||||
|
||||
for (let platform of platforms) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) => ({
|
||||
|
Reference in New Issue
Block a user