mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
feat(webpack): add svelte support (#8963)
This commit is contained in:

committed by
Nathan Walker

parent
32404246a1
commit
0afea8681c
@ -1,7 +1,7 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
const { isTypeScript, isAngular, isVue, isReact, isShared, isPlugin } = require("./projectHelpers");
|
||||
const { isTypeScript, isAngular, isVue, isReact, isSvelte, isShared, isPlugin } = require("./projectHelpers");
|
||||
|
||||
function addProjectFiles(projectDir) {
|
||||
const projectTemplates = getProjectTemplates(projectDir);
|
||||
@ -73,6 +73,8 @@ function getProjectTemplates(projectDir) {
|
||||
templates = getVueTemplates(WEBPACK_CONFIG_NAME);
|
||||
} else if (isReact({ projectDir })) {
|
||||
templates = getReactTemplates(WEBPACK_CONFIG_NAME);
|
||||
} else if (isSvelte({ projectDir })) {
|
||||
templates = getSvelteTemplates(WEBPACK_CONFIG_NAME);
|
||||
} else if (isTypeScript({ projectDir })) {
|
||||
templates = getTypeScriptTemplates(WEBPACK_CONFIG_NAME);
|
||||
} else {
|
||||
@ -113,6 +115,12 @@ function getReactTemplates(webpackConfigName) {
|
||||
};
|
||||
}
|
||||
|
||||
function getSvelteTemplates(webpackConfigName) {
|
||||
return {
|
||||
"webpack.svelte.js": webpackConfigName
|
||||
};
|
||||
}
|
||||
|
||||
function getJavaScriptTemplates(webpackConfigName) {
|
||||
return {
|
||||
"webpack.javascript.js": webpackConfigName,
|
||||
@ -141,4 +149,4 @@ module.exports = {
|
||||
removeProjectFiles,
|
||||
forceUpdateProjectFiles,
|
||||
compareProjectFiles,
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user