当我在构建文件中添加appDir条目时,我得到以下错误。
C:\Users\Thupten\Development\experiments>node r.js -o build.js
TypeError: Cannot read property 'length' of undefined at Function.build.makeAbsPath (C:\Users\Thupten\Development\experiments\r.js:22452:51)
这是我的构建文件
({
appDir:"./SimpleRequireJsProject",
baseUrl: "scripts",
mainConfigFile: './SimpleRequireJsProject/scripts/main.js',
include:'entrance.js', //relative to baseUrl
name:"main",
out:"main-built.js",
optimize:"none"
})
我做错了什么?
答案 0 :(得分:1)
已解决,appDir
选项与out
选项不兼容,请改用dir
选项。例如:
({
appDir: '.',
baseUrl: 'lib',
dir: '../demo-build'
})