首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ember-cli背后的窥视(EmberApp):vendor.js和app.js

ember-cli背后的窥视(EmberApp):vendor.js和app.js
EN

Stack Overflow用户
提问于 2015-06-23 00:22:01
回答 1查看 1.1K关注 0票数 0

使用出色的broccoli-stew,我可以查看导出的应用程序树:

代码语言:javascript
复制
/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var log   = require('broccoli-stew').log;
var debug = require('broccoli-stew').debug;

var app = new EmberApp();

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

app.import('bower_components/ember-i18n/lib/i18n.js');
app.import('bower_components/raphael/raphael.js');

var finalTree = log(app.toTree());

module.exports = finalTree;

这样,我的应用程序就得到了非常干净的树状输出:

代码语言:javascript
复制
[ 'assets/app.js',
  'assets/app.map',
  'assets/app.scss',
  ...
  'assets/vendor.css',
  'assets/vendor.js',
  'assets/vendor.map',
  'crossdomain.xml',
  'index.html',
  'robots.txt',
  'testem.js',
  'tests/index.html' ]

我看到在该树中,除了其他文件之外,我们还有一个vendor.js和一个app.js模块(不出所料),但我不知道每个模块中都放入了什么包。

我感觉我的前端(在本例中是raphael.js)遗漏了一个,所以我想验证ember-cli (通过EmberApp)确实完成了我所要求的(即,包括raphael.js,可能是在vendor.js中)

直接查看app.jsvendor.js是不可行的(太大/不知道要找什么)。我想要一个简单的树状显示,以与broccoli-stew提供的相同(类似)格式显示EmberApp包含到vendor.js / app.js中的文件。

这个是可能的吗?多么?

EN

回答 1

Stack Overflow用户

发布于 2015-07-07 04:40:41

引用http://www.ember-cli.com/asset-compilation/#configuring-output-paths

代码语言:javascript
复制
Assets                                          Output File
JavaScript files you import with app.import()   /assets/vendor.js

因此,尽管这不是一个很好的树视图,但您应该很好:-)

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30985045

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档