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
+};