requirejsアプリがロードされません
-
22-12-2019 - |
質問
だから、私はを使用してrequirejsアプリを構築しました。シーンの後ろのJS。ただし、アプリを実行すると、私は毎回これを取得します。
Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded require-2.1.9.min.js:8
GET http://localhost:8080/resources/js/app/App.js 404 (Not Found) require-2.1.9.min.js:34
Uncaught Error: Script error for: app/App
http://requirejs.org/docs/errors.html#scripterror
.
マイ「メイン」スクリプトはapp / main.jsにあり、次のようになります。
require(['common'], function() {
'use strict';
require(['app/App'], function(app) {
app.start();
});
});
.
requirejs: {
options: {
baseUrl: 'resources/js',
dir: 'resources/js/build',
main: 'app/Main',
out: null,
optimize: 'uglify2',
skipDirOptimize: true,
priority: ['common'],
preserveLicenseComments: false,
modules: [
{
name: 'common'
},{
name: 'app/Main',
exclude: ['common'],
include: ['app/App']
}
],
paths: { ... },
shim: { ... }
}
}
.
解決
ビルド設定でfindNestedDependencies : true
オプションを忘れていて、ネストされた要求はロードされませんでした。その説明
所属していません StackOverflow