我有这个webpack的基本设置:
{
context: rootDir,
entry: {
main: scriptsPath + "Main.ts",
app: [/* this is filled by the aurelia-webpack-plugin */]
},
output: {
path: destDir,
library: "[name]",
filename: "[name]-bundle.js"
},
module: {...loaders},
resolve: {...},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: "main",
minChunks: Infinity
}),
new AureliaWebpackPlugin({
src: appPath,
root: rootDir
}),
]
};
我的Main.ts
仅导入骨架应用程序附带的所有aurelia-*
包,以及Jquery和Bootstrap。正如预期的那样,我得到了两个名为main-bundle.js
和app-bundle.js
的独立包。但是在运行时,浏览器会抛出以下错误:
Error: Cannot find module './aurelia-templating-resources/compose'.
我已将其追溯到aurelia webpack插件,但未生成webpackContextResolve
函数使用的正确上下文映射。我对如何解决这个问题感到茫然。任何帮助表示赞赏。
环境详情:
更新
我按照this issue上的说明更新了 Webpack到2.1.0-beta.24 ,但仍然遇到此错误以及许多其他类似错误:
Error: Cannot find module './aurelia-templating-resources/binding-mode-behaviors'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/repeat'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/with'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/if'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/compose'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-router/route-href'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/update-trigger-binding-behavior'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-router/router-view'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/signal-binding-behavior'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/debounce-binding-behavior'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/sanitize-html'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/replaceable'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/hide'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/show'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/throttle-binding-behavior'. app-bundle.js:42:9
Error: Cannot find module './aurelia-templating-resources/focus'.