From d691d6df0cd2fca1918fc294563412167dc07975 Mon Sep 17 00:00:00 2001 From: coveoben Date: Mon, 5 Feb 2018 16:11:41 -0800 Subject: [PATCH] Fix issue with undefined 'salesforce' variable. An undefined Salesforce variable was causing an issue for developers who were choosing the local development option instead of the SF development option. This change resolves the problem. --- generators/typescript/templates/webpack.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generators/typescript/templates/webpack.config.js b/generators/typescript/templates/webpack.config.js index 75600d7..45f88c0 100644 --- a/generators/typescript/templates/webpack.config.js +++ b/generators/typescript/templates/webpack.config.js @@ -8,7 +8,7 @@ const plugins = []; if (minimize) { plugins.push(new webpack.optimize.UglifyJsPlugin()); } -<% if(salesforce) { %> +<% if (!(typeof salesforce === 'undefined' || salesforce === null)) { %> const coveoComponentMock = ` @@ -23,7 +23,7 @@ if (minimize) { if (!production) { plugins.push(new webpack.HotModuleReplacementPlugin()); - <% if(salesforce) { %> + <% if (!(typeof salesforce === 'undefined' || salesforce === null)) { %> plugins.push(new VisualforceHtmlPlugin({ SalesforceContext: { CustomModifiers: { @@ -62,4 +62,4 @@ module.exports = { }, plugins: plugins, bail: true -}; \ No newline at end of file +};