Skip to content
This repository was archived by the owner on Jul 15, 2020. It is now read-only.

Commit 4c63ae9

Browse files
authored
Merge pull request #3 from coveoben/patch-1
Fix issue with undefined 'salesforce' variable. Fix #1
2 parents 19f8093 + d691d6d commit 4c63ae9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

generators/typescript/templates/webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const plugins = [];
88
if (minimize) {
99
plugins.push(new webpack.optimize.UglifyJsPlugin());
1010
}
11-
<% if(salesforce) { %>
11+
<% if (!(typeof salesforce === 'undefined' || salesforce === null)) { %>
1212
const coveoComponentMock = `
1313
<script src="../vendor/coveo/js/CoveoJsSearch.Lazy.js"></script>
1414
<script src="../vendor/coveo/js/templates/templates.js"></script>
@@ -23,7 +23,7 @@ if (minimize) {
2323

2424
if (!production) {
2525
plugins.push(new webpack.HotModuleReplacementPlugin());
26-
<% if(salesforce) { %>
26+
<% if (!(typeof salesforce === 'undefined' || salesforce === null)) { %>
2727
plugins.push(new VisualforceHtmlPlugin({
2828
SalesforceContext: {
2929
CustomModifiers: {
@@ -62,4 +62,4 @@ module.exports = {
6262
},
6363
plugins: plugins,
6464
bail: true
65-
};
65+
};

0 commit comments

Comments
 (0)