mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(webpack): add svelte support (#8963)
This commit is contained in:
committed by
Nathan Walker
parent
32404246a1
commit
0afea8681c
@@ -51,6 +51,13 @@ const isReact = ({ projectDir, packageJson } = {}) => {
|
||||
.some(dependency => dependency === "react-nativescript");
|
||||
};
|
||||
|
||||
const isSvelte = ({ projectDir, packageJson } = {}) => {
|
||||
packageJson = packageJson || getPackageJson(projectDir);
|
||||
|
||||
return packageJson.dependencies && Object.keys(packageJson.dependencies)
|
||||
.some(dependency => dependency === "svelte-native");
|
||||
};
|
||||
|
||||
const getPackageJson = projectDir => {
|
||||
const packageJsonPath = getPackageJsonPath(projectDir);
|
||||
const result = readJsonFile(packageJsonPath);
|
||||
@@ -102,7 +109,7 @@ const getPackageJsonPath = projectDir => {
|
||||
} else {
|
||||
return getPackageJsonPath(resolve(projectDir, '..'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const getNsConfigPath = projectDir => resolve(projectDir, "nsconfig.json");
|
||||
|
||||
@@ -145,6 +152,7 @@ module.exports = {
|
||||
getAngularVersion,
|
||||
isVue,
|
||||
isReact,
|
||||
isSvelte,
|
||||
isTypeScript,
|
||||
writePackageJson,
|
||||
convertSlashesInPath,
|
||||
|
||||
Reference in New Issue
Block a user