Skip to content

Instantly share code, notes, and snippets.

@sarmanulco
Last active October 15, 2018 18:54
Show Gist options
  • Save sarmanulco/fd2415c2b81db3df457302c61d77f197 to your computer and use it in GitHub Desktop.
Save sarmanulco/fd2415c2b81db3df457302c61d77f197 to your computer and use it in GitHub Desktop.
dynamic imports
ERROR in ./src/router/routes.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/raul/Documentos/Proyectos/Adifia/web/src/router/routes.js: Support for the experimental syntax 'dynamicImport' isn't currently enabled (38:30):
{
"scripts": {
"start": "concurrently 'nodemon' 'cd docs && nodemon'",
"dev": "coffee -t app.coffee",
"build:watch": "cd web/ && webpack --config config/webpack/webpack.config.js"
},
"repository": {
"type": "git",
"url": "git+https://gitlab.com/sarmanulco/Adifia_web.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/sarmanulco/Adifia_web/issues"
},
"homepage": "https://gitlab.com/sarmanulco/Adifia_web#README",
"dependencies": {
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.18.3",
"chalk": "^2.4.1",
"coffeescript": "^2.3.2",
"css-loader": "^1.0.0",
"express": "^4.16.3",
"gm": "^1.23.1",
"include-media": "^1.4.9",
"jwt-simple": "^0.5.5",
"moment": "^2.22.2",
"mongoose": "^5.2.17",
"morgan": "^1.9.1",
"multer": "^1.4.0",
"node-sass": "^4.9.4",
"pug": "^2.0.3",
"query-string": "^6.2.0",
"read-yaml": "^1.1.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"vue": "^2.5.17",
"vue-head": "^2.0.12",
"vue-hot-reload-api": "^2.3.1",
"vue-json-pretty": "^1.4.1",
"vue-quill-editor": "^3.0.6",
"vue-server-renderer": "^2.5.17",
"vuex-map-fields": "^1.3.1",
"vuex-persistedstate": "^2.5.4"
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@vue/component-compiler-utils": "^2.2.0",
"babel-core": "6.x.x",
"babel-plugin-syntax-dynamic-import": "6.x.x",
"babel-preset-env": "^1.7.0",
"vue-template-compiler": "^2.5.17"
}
}
import home from '../pages/home.vue'
function route(name, path, component, meta = {}, children = []) {
return {name, path, component, meta, children}
}
export default [
// route('home', '/', () => import('../pages/home.vue')), <- If I uncomment this, I get the error
route('home', '/', home),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment