ncc打包代码出错,找不到jade模板文件?

新手上路,请多包涵

本地运行一切正常,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)

求教大神,感谢!

阅读 2.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏