Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
fix(demo): Add promise polyfill if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
matsp committed Feb 28, 2018
1 parent 2031121 commit be8ec36
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './polyfills.js'

import Vue from 'vue'
import router from './router/'
import store from './store/'
Expand Down Expand Up @@ -49,10 +51,6 @@ Vue.use(Textfield)
Vue.use(Toolbar)
Vue.use(Typography)





/* eslint-disable no-new */
new Vue({
el: '#app',
Expand Down
3 changes: 3 additions & 0 deletions demo/polyfills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (typeof Promise === 'undefined') {
import('core-js/fn/promise')
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"babel-loader": "^8.0.0-beta.2",
"clean-webpack-plugin": "^0.1.18",
"copy-webpack-plugin": "^4.4.2",
"core-js": "^2.5.3",
"css-loader": "^0.28.10",
"eslint": "^4.18.1",
"eslint-config-standard": "^11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = {
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
return module.context && module.context.indexOf('node_modules') !== -1
return module.context && (module.context.indexOf('node_modules') !== -1 || module.context.indexOf('dist') !== -1)
}
}),
new webpack.optimize.CommonsChunkPlugin({
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,10 @@ copy-webpack-plugin@^4.4.2:
p-limit "^1.0.0"
serialize-javascript "^1.4.0"

core-js@^2.5.3:
version "2.5.3"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"

core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
Expand Down

2 comments on commit be8ec36

@matsp
Copy link
Owner Author

@matsp matsp commented on be8ec36 Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closes #73

@matsp
Copy link
Owner Author

@matsp matsp commented on be8ec36 Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to load the polyfill only if needed when all is build with webpack.
Using polyfill.io could be an alternative..

Please sign in to comment.