chore: scaffold config auto-discovery

This commit is contained in:
Igor Randjelovic
2020-11-18 20:36:54 +01:00
parent f8cd50e495
commit 4518cfa31b
3 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,11 @@
// todo: refine
export function error(message: string, info?: { possibleCauses?: string[] }) {
console.error(`
NativeScript Webpack encountered an error and cannot proceed with the build:
${message}
Possible causes:
${info?.possibleCauses?.map((cause) => `- ${cause}`).join('\n')}
`);
}

View File

@ -0,0 +1,18 @@
import { defaultConfigs } from '@nativescript/webpack';
export function determineProjectFlavor(): keyof typeof defaultConfigs {
// todo;
// error(`
// Could not determine project flavor.
//
// Please use webpack.useConfig('<flavor>') to explicitly set the base config.
// `, {
// possibleCauses: [
// 'Not in a NativeScript project',
// 'The project is not at the current working directory'
// ]
// })
return 'vue';
}