Skip to content

Commit d93e0a7

Browse files
committed
refactor(client): refactor polyfills
1 parent 63f5c12 commit d93e0a7

File tree

3 files changed

+16
-42
lines changed

3 files changed

+16
-42
lines changed

templates/app/client/app/polyfills.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ import 'core-js/es6';
22
import 'core-js/es7/reflect';
33
import 'zone.js/dist/zone';
44

5+
<%_ if(filters.ts) { _%>
6+
// Typescript emit helpers polyfill
7+
import 'ts-helpers';
8+
9+
interface IPolyFillErrorConstructor extends ErrorConstructor {
10+
stackTraceLimit: any;
11+
}<% } %>
12+
513
if(!ENV) {
6-
var ENV = 'development';
14+
var ENV = 'development';
715
}
816

917
if(ENV === 'production') {
10-
// Production
18+
// Production
1119
} else {
12-
// Development
20+
// Development
1321

22+
<%_ if(filters.ts) { _%>
23+
(<IPolyFillErrorConstructor>Error).stackTraceLimit = Infinity;<% } else { %>
1424
Error.stackTraceLimit = Infinity;
15-
16-
require('zone.js/dist/long-stack-trace-zone');
25+
<% } %>
26+
// require('zone.js/dist/long-stack-trace-zone');
1727
}

templates/app/client/polyfills.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

templates/app/webpack.make.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function makeWebpackConfig(options) {
3838
} else {
3939
config.entry = {
4040
app: './client/app/app.<%= scriptExt %>',
41-
polyfills: './client/polyfills.<%= scriptExt %>',
41+
polyfills: './client/app/polyfills.<%= scriptExt %>',
4242
vendor: [
4343
'lodash'
4444
]

0 commit comments

Comments
 (0)