1
webpackからバンドルされたapp.jsの2つのバンドルファイルが必要です。私のフォルダは次のようになります:jsファイルでwebpackバンドルを要求する方法
MyApp
|-app
| -app.js <-this gets bundled
|-hero
| -hero.module <- this gets also bundled
| -some other stuff that will be bundled in hero.bundle.js
|-crisis
| -crisis.module <- gets bundled
| -more stuff that gets bundled in crisis.bundle.js
-
これまでのところとても良いです。 私はapp.jsの私のCOmponent Routerで怠惰なロード/ルーティングを行っているので、hero.bundle.jsとcrisis.bundle.jsをapp.jsに入れたいと思っています。 しかし、モジュールが見つからないというエラーは常に出てきます。 1の 構文例は、次のものが必要です
path: '/heroes/...',
name: 'Heroes',
loader: function() {
// lazy load Heroes
return $ocLazyLoad.load([require('./dist/heroes.bundle.js')])
.then(function() {
return 'heroes';
});
}
は私が何か間違ったことをしますか?事前:)
このhttps://webpack.github.io/docs/code-splitting.html私は実際にwが私のwebpack.config.jsでバンドルを作成し – highFlyingDodo
iエントリと出力、CommonsChunkではなく 唯一のことは、bundle.jsファイルをjavascriptファイルに含める方法です.HTMLではありません。 – julesrose