프로젝트에 Angular + Require를 사용하고 있습니다. r.js를 사용하여 응용 프로그램을 패키지하려고하면 다음을 사용하십시오.RequireJS의 절대 라이브러리 의존성
node r.js -o app.build.config.js
모든 것은 라이브러리 파일을 제외하고 작동합니다. 제공된 경로에서 해당 파일을 찾는 대신 종속성을 대상으로 제공하는 폴더를 기준으로 조회합니다.
...if you prefer the "main" JS file configuration to be read for the build so that you do not have to duplicate the values in a separate configuration, set this property to the location of that main JS file. The first requirejs({}), require({}), requirejs.config({}), or require.config({}) call found in that file will be used.
그래서 빌드 : 당신의 라이브러리 (예를 들어, 각도)의 위치를 찾기 위해 런타임 코드에 의해 사용되는 동일한 구성을 공유하려는 경우
({
appDir: "C:/dev/etc/",
baseUrl: "javascript/core/",
dir: "app-build/",
modules: [
{
name: "application",
out: "app.js"
}
],
findNestedDependencies: true
})