本地运行一切正常,jade页面模板也能正常渲染,但是用ncc打包就报错。
app.js
var app = express();
// 页面模板引擎设置
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
在终端进行打包
ncc build ./bin/www
显示
ncc: Version 0.36.1
ncc: Compiling file index.js into CJS
ncc: Ignoring build of uglify-js, as it is not statically analyzable. Build with "--external uglify-js" if this package is needed.
ncc: Ignoring build of uglify-js, as it is not statically analyzable. Build with "--external uglify-js" if this package is needed.
0kB dist/views/layout.jade
0kB dist/views/index.jade
0kB dist/views/error.jade
139kB dist/domprops.json
1481kB dist/index.js
1620kB [13038ms] - ncc 0.36.1
执行node index.js就马上报错了
/Users/dr/Documents/project/webadmin/dist/index.js:4526
baseParts = baseName.split('/');
^
TypeError: baseName.split is not a function
at normalize (/Users/heyboy/Documents/project/webadmin/dist/index.js:4526:38)
求教大神,感谢!