diff --git a/projectFilesManager.js b/projectFilesManager.js index 1a3855d4..c2ccd8e1 100644 --- a/projectFilesManager.js +++ b/projectFilesManager.js @@ -5,7 +5,7 @@ const { isTypeScript, isAngular, isVue } = require("./projectHelpers"); function addProjectFiles(projectDir) { const projectTemplates = getProjectTemplates(projectDir); - Object.keys(projectTemplates).forEach(function(templateName) { + Object.keys(projectTemplates).forEach(function (templateName) { const templateDestination = projectTemplates[templateName]; templateName = path.resolve(templateName); copyTemplate(templateName, templateDestination); @@ -14,7 +14,7 @@ function addProjectFiles(projectDir) { function removeProjectFiles(projectDir) { const projectTemplates = getProjectTemplates(projectDir); - Object.keys(projectTemplates).forEach(function(templateName) { + Object.keys(projectTemplates).forEach(function (templateName) { const templateDestination = projectTemplates[templateName]; deleteFile(templateDestination); }); @@ -32,7 +32,7 @@ function compareProjectFiles(projectDir) { if (fs.existsSync(currentTemplatePath)) { const currentTemplate = fs.readFileSync(currentTemplatePath).toString(); const newTemplate = fs.readFileSync(newTemplatePath).toString(); - if (newTemplate !== currentTemplate) { + if (newTemplate.replace(/\s/g, '') !== currentTemplate.replace(/\s/g, '')) { const message = `The current project contains a ${path.basename(currentTemplatePath)} file located at ${currentTemplatePath} that differs from the one in the new version of the nativescript-dev-webpack plugin located at ${newTemplatePath}. Some of the plugin features may not work as expected until you manually update the ${path.basename(currentTemplatePath)} file or automatically update it using "./node_modules/.bin/update-ns-webpack --configs" command.`; console.info(`\x1B[33;1m${message}\x1B[0m`); }