Commit 4537fdd6 authored by Evan You's avatar Evan You

use dynamic import instead of System.import

parent 6a243c60
{ {
"presets": [ "presets": [
["env", { "modules": false }] ["env", { "modules": false }]
],
"plugins": [
"syntax-dynamic-import"
] ]
} }
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
"autoprefixer": "^6.7.7", "autoprefixer": "^6.7.7",
"babel-core": "^6.24.1", "babel-core": "^6.24.1",
"babel-loader": "^6.4.1", "babel-loader": "^6.4.1",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-preset-env": "^1.4.0", "babel-preset-env": "^1.4.0",
"css-loader": "^0.28.0", "css-loader": "^0.28.0",
"file-loader": "^0.11.1", "file-loader": "^0.11.1",
......
...@@ -4,9 +4,9 @@ import Router from 'vue-router' ...@@ -4,9 +4,9 @@ import Router from 'vue-router'
Vue.use(Router) Vue.use(Router)
// route-level code splitting // route-level code splitting
const createListView = id => () => System.import('../views/CreateListView').then(m => m.default(id)) const createListView = id => () => import('../views/CreateListView').then(m => m.default(id))
const ItemView = () => System.import('../views/ItemView.vue') const ItemView = () => import('../views/ItemView.vue')
const UserView = () => System.import('../views/UserView.vue') const UserView = () => import('../views/UserView.vue')
export function createRouter () { export function createRouter () {
return new Router({ return new Router({
......
...@@ -362,6 +362,10 @@ babel-plugin-syntax-async-functions@^6.8.0: ...@@ -362,6 +362,10 @@ babel-plugin-syntax-async-functions@^6.8.0:
version "6.13.0" version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
babel-plugin-syntax-dynamic-import@^6.18.0:
version "6.18.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
babel-plugin-syntax-exponentiation-operator@^6.8.0: babel-plugin-syntax-exponentiation-operator@^6.8.0:
version "6.13.0" version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment