diff --git a/lib/util.js b/lib/util.js index b6ff058..4d831bd 100644 --- a/lib/util.js +++ b/lib/util.js @@ -144,7 +144,7 @@ function generatePreviewHead(parsedConfig) { continue; } doc.push(`<${key} ${objectToHTMLAttributes(value)}>${key}>`); - if(value.src.indexOf('assets/vendor.js') > -1) { + if(value.src.match(/assets\/vendor[^.]*\.js/)) { // make sure we push this right after vendor to ensure the application does not bind to the window. doc.push(''); } diff --git a/node-tests/__snapshots__/util.test.js.snap b/node-tests/__snapshots__/util.test.js.snap index 2eaa81b..559e97b 100644 --- a/node-tests/__snapshots__/util.test.js.snap +++ b/node-tests/__snapshots__/util.test.js.snap @@ -15,6 +15,16 @@ exports[`util @generatePreviewHead should work with file created with \`ember bu " `; +exports[`util @generatePreviewHead should work with file created with \`ember build\` in production env 1`] = ` +" + + + + + +" +`; + exports[`util @generatePreviewHead should work with file created with \`ember serve\` (should append livereload pointing at serve instance) 1`] = ` " diff --git a/node-tests/fixtures/build-production.html b/node-tests/fixtures/build-production.html new file mode 100644 index 0000000..2d27076 --- /dev/null +++ b/node-tests/fixtures/build-production.html @@ -0,0 +1,25 @@ + + +
+ +