fix IE11 build

This commit is contained in:
Monica Dinculescu
2017-01-17 15:16:23 -08:00
parent d971c3450c
commit 0b02500cfb
3 changed files with 14 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
import '../bower_components/webcomponents-platform/webcomponents-platform.js'
import '../bower_components/URL/url.js'
import '../bower_components/template/template.js'
import '../bower_components/es6-promise/lib/es6-promise.js'
import '../bower_components/es6-promise/dist/es6-promise.auto.min.js'
import '../bower_components/html-imports/src/html-imports.js'
import '../src/pre-polyfill.js'
import '../bower_components/custom-elements/custom-elements.min.js'

View File

@@ -33,16 +33,24 @@ const babiliConfig = {
shouldPrintComment: singleLicenseComment()
};
function minify(sourceName, fileName) {
function minify(sourceName, fileName, needsContext) {
if (!fileName)
fileName = sourceName;
return rollup({
var options = {
entry: './entrypoints/' + sourceName + '-index.js',
format: 'iife',
moduleName: 'webcomponentsjs',
sourceMap: true
})
}
// The es6-promise polyfill needs to set the correct context.
// See https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
if (needsContext) {
options.context = 'window';
};
return rollup(options)
.pipe(source(sourceName +'-index.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
@@ -69,7 +77,7 @@ gulp.task('minify-hi-ce-sd', () => {
});
gulp.task('minify-hi-ce-sd-pf', () => {
minify('webcomponents-hi-ce-sd-pf', 'webcomponents-lite')
minify('webcomponents-hi-ce-sd-pf', 'webcomponents-lite', true)
});
gulp.task('default', ['minify-none', 'minify-hi', 'minify-hi-ce', 'minify-hi-ce-sd', 'minify-hi-ce-sd-pf']);

View File

@@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
<html>
<head>
<title>Template with HTMLImports Test</title>
<title>Integration Test</title>
<script src="../webcomponents-loader.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="imports/simple-element.html">