我环顾四周,但找不到与Ember一起包含Bootstrap的正确方法。我不想要ember-bootstrap
软件包,因为它不支持bootstrap 4
。
我也迷失了每篇文章,都告诉使用Bower安装它,但是由于Bower已使用纱线重新放置,我不想使用不弃用的方法。
我尝试了很多次,但是当我尝试在我的 ember-cli-build.js
中导入bootstrap.js文件时,它总是失败的 -> app.import('bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js');
我有这个错误
The Broccoli Plugin: [BroccoliMergeTrees: TreeMerger (vendor & appJS)]
failed with:
Error: ENOENT: no such file or directory, open '/private/tmp/my-first-
ember-app/tmp/source_map_concat-input_base_path-
S9AGEQc7.tmp/bower_components/bootstrap-sass-
official/assets/javascripts/bootstrap.js'
非常感谢!
您可以为bootstrap做npm install bootstrap@4.0.0-alpha.6
,并通过node_modules
文件夹通过ember-cli-build.js
文件导入所需的文件。
对于导入node_modules文件,您应该具有Ember-CLI版本2.15。
您的问题中的假设错误。Ember-Bootstrap确实支持Bootstrap 4,因为版本1.0.0-Alpha.5于2017年2月27日发布。设置指南中有一个部分有关如何切换到Bootstrap 4的部分。
。简而言之是:
-
ember install ember-bootstrap
-
ember generate ember-bootstrap --bootstrap-version=4
Ember-Bootstrap 1.0.0尚未发布。当前版本为1.0.0-rc.4。同样,Bootstrap 4支持仅是实验性的。但这主要是由Bootstrap 4尚未稳定释放引起的。
如果您不喜欢或不需要Ember-bootstrap的组成部分,那么您只需导入Bootstrap Assets,如Kumkanillam所述。