diff --git a/demo/index.js b/demo/index.js index d2f578151..a7c387081 100644 --- a/demo/index.js +++ b/demo/index.js @@ -1,3 +1,5 @@ +import './polyfills.js' + import Vue from 'vue' import router from './router/' import store from './store/' @@ -49,10 +51,6 @@ Vue.use(Textfield) Vue.use(Toolbar) Vue.use(Typography) - - - - /* eslint-disable no-new */ new Vue({ el: '#app', diff --git a/demo/polyfills.js b/demo/polyfills.js new file mode 100644 index 000000000..7f83c7eab --- /dev/null +++ b/demo/polyfills.js @@ -0,0 +1,3 @@ +if (typeof Promise === 'undefined') { + import('core-js/fn/promise') +} diff --git a/package.json b/package.json index fe69e1c80..11370c4fd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/webpack.config.common.js b/webpack.config.common.js index e502d92df..51535943b 100644 --- a/webpack.config.common.js +++ b/webpack.config.common.js @@ -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({ diff --git a/yarn.lock b/yarn.lock index 463bad98c..0fa7bfb82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"