mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
feat(webpack): using new nativescript.config (#8796)
This commit is contained in:
@ -88,7 +88,15 @@ const getIndentationCharacter = (jsonContent) => {
|
||||
|
||||
const getProjectDir = hook.findProjectDir;
|
||||
|
||||
const getPackageJsonPath = projectDir => resolve(projectDir, "package.json");
|
||||
const getPackageJsonPath = projectDir => {
|
||||
const packagePath = resolve(projectDir, "package.json");
|
||||
if (fs.existsSync(packagePath)) {
|
||||
return packagePath;
|
||||
} else {
|
||||
return getPackageJsonPath(resolve(projectDir, '..'));
|
||||
}
|
||||
|
||||
}
|
||||
const getNsConfigPath = projectDir => resolve(projectDir, "nsconfig.json");
|
||||
|
||||
const isAndroid = platform => /android/i.test(platform);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nativescript/webpack",
|
||||
"version": "2.1.3",
|
||||
"version": "3.0.0-rc.0",
|
||||
"main": "index",
|
||||
"description": "Webpack plugin for NativeScript",
|
||||
"homepage": "https://nativescript.org",
|
||||
|
@ -214,6 +214,7 @@ module.exports = env => {
|
||||
'node_modules'
|
||||
],
|
||||
alias: {
|
||||
'~/package.json': resolve(projectRoot, 'package.json'),
|
||||
'~': appFullPath,
|
||||
"tns-core-modules": "@nativescript/core",
|
||||
"nativescript-angular": "@nativescript/angular"
|
||||
|
@ -67,6 +67,7 @@ module.exports = env => {
|
||||
const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot });
|
||||
let coreModulesPackageName = "tns-core-modules";
|
||||
const alias = env.alias || {};
|
||||
alias['~/package.json'] = resolve(projectRoot, 'package.json');
|
||||
alias['~'] = appFullPath;
|
||||
|
||||
if (hasRootLevelScopedModules) {
|
||||
|
@ -70,6 +70,7 @@ module.exports = env => {
|
||||
const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot });
|
||||
let coreModulesPackageName = "tns-core-modules";
|
||||
const alias = env.alias || {};
|
||||
alias['~/package.json'] = resolve(projectRoot, 'package.json');
|
||||
alias['~'] = appFullPath;
|
||||
|
||||
if (hasRootLevelScopedModules) {
|
||||
|
@ -68,6 +68,7 @@ module.exports = env => {
|
||||
const hasRootLevelScopedModules = nsWebpack.hasRootLevelScopedModules({ projectDir: projectRoot });
|
||||
let coreModulesPackageName = "tns-core-modules";
|
||||
const alias = env.alias || {};
|
||||
alias['~/package.json'] = resolve(projectRoot, 'package.json');
|
||||
alias['~'] = appFullPath;
|
||||
alias['@'] = appFullPath;
|
||||
alias['vue'] = 'nativescript-vue';
|
||||
|
Reference in New Issue
Block a user