Routing canjs中不作为链接工作的路由未获得href值

Routing canjs中不作为链接工作的路由未获得href值,routing,canjs,Routing,Canjs,我是canjs的新手,在canjs网站上学习教程。我正在使用webpack创建一个示例canjs页面 import { Component, stacheRouteHelpers } from "can"; Component.extend({ tag: "my-app", view: ` <a href="{{ routeUrl(page='home') }}">Home</a> <a href="{{ route

我是canjs的新手,在canjs网站上学习教程。我正在使用webpack创建一个示例canjs页面

import { Component, stacheRouteHelpers } from "can";

Component.extend({
    tag: "my-app",
    view: `
        <a href="{{ routeUrl(page='home') }}">Home</a>
        <a href="{{ routeUrl(page='tasks') }}">Tasks</a>
    `,
    ViewModel: {
    }
});

就像Justin提到的那样,我认为webpack在构建过程中正在动摇树
stacheRouteHelpers

我认为您可以通过以下方式解决问题:

从“can”导入{Component,stache,stacheRouteHelpers};
stache.addHelper(stacheRouteHelpers);

就像Justin提到的那样,我认为webpack是一个颠覆性的
stacheRouteHelpers
版本

我认为您可以通过以下方式解决问题:

从“can”导入{Component,stache,stacheRouteHelpers};
stache.addHelper(stacheRouteHelpers);

我认为webpack是stacheRouteHelpers,因为它没有直接在该文件中使用(模板不算在内)。有没有办法告诉webpack不要树化模块?我认为webpack是stacheRouteHelpers,因为它没有直接在该文件中使用(模板不算在内)。有没有办法告诉webpack不要在树上创建模块?
<a href="">Home</a>
MyAppView:3: Unable to find key "routeUrl()".