以下代码报这个错误,求教
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (9:11)
// ...
const flex = () => import("view/flex/flexDice"); // 第九行 Unexpected token
const animate = () => import("view/animate/animation");
const css3d = () => import("view/3d/css3d");
const d3 = () => import("view/d3/d3");
const vue2 = () => import("view/vue2/vue2");
const pwa = () => import("view/pwa/pwa");
const search = () => import("view/search/search");
let routes = [
{path:'/flex',component:flex},
{path:'/d3js',component:d3},
{path:'/anmiation',component:animate},
{path:'/3D',component:css3d},
{path:'/vue2',component:vue2},
{path:'/pwa',component:pwa},
{path:'/search',component:search},
// { path: '404', component:loadCmp('404/404') },
// { path: '*', redirect: { path:'/404' } }
];
export default routes;
const flex = r => require.ensure([], () => r(require(
'view/flex/flexDice')), 'flex');
我这样写没问题