Skip to content

Commit

Permalink
fix(bug): fixes an issue where polyfills with es2015 block scoping wo…
Browse files Browse the repository at this point in the history
…uld cause issues in older browers
  • Loading branch information
wessberg committed Mar 28, 2019
1 parent 1cdcbb5 commit 4efd9dd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
},
"dependencies": {
"@babel/core": "^7.4.0",
"@babel/plugin-transform-block-scoping": "^7.4.0",
"@types/astring": "^1.3.0",
"@types/file-type": "^10.9.1",
"@types/iltorb": "^2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/constant/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const constant: IConstant = {
},
features: [],
version: environment.NPM_PACKAGE_DEPENDENCIES_SYSTEMJS,
dependencies: ["es.promise", "fetch"],
dependencies: ["es.object.create", "es.object.freeze", "es.object.define-property", "es.promise", "fetch"],
contexts: ALL_CONTEXTS
},
zone: {
Expand Down
2 changes: 1 addition & 1 deletion src/service/minify/minify-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class MinifyService implements IMinifyService {
sourceMaps: false,
root: "",
presets: [],
plugins: []
plugins: ["@babel/plugin-transform-block-scoping"]
});
return result.code;
}
Expand Down
4 changes: 2 additions & 2 deletions test/server/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test("Will not generate polyfills for 'Element' on Chrome 69 for a Galaxy S5", a
t.true(result.statusCode === constants.HTTP_STATUS_OK);
});

test.only("Will generate correct polyfills for IE11", async t => {
test("Will generate correct polyfills for IE11", async t => {
const result = await sendRequest({
http2: config.http2,
tls: true,
Expand All @@ -71,7 +71,7 @@ test.only("Will generate correct polyfills for IE11", async t => {
port: config.port,
path: `${
constant.endpoint.polyfill
}?features=web-components,es,class-list,system|variant=system,custom-event,url,fetch,object-fit,intersection-observer,animation,regenerator-runtime,requestanimationframe,requestidlecallback,resize-observer,pointer-event,dom.collections.iterable,scroll-behavior,zone|error|rxjs|shadydom,esnext.reflect,intl|force|locale=en~da`,
}?features=web-components,es,class-list,systemjs|variant=system,custom-event,url,fetch,object-fit,intersection-observer,animation,regenerator-runtime,requestanimationframe,requestidlecallback,resize-observer,pointer-event,dom.collections.iterable,scroll-behavior,zone|error|rxjs|shadydom,esnext.reflect,intl|force|locale=en~da`,
acceptEncoding: undefined
});

Expand Down

0 comments on commit 4efd9dd

Please sign in to comment.