如何安装 Bower 包中包含的附加模块?
How to install additional modules included in a Bower package?
我无法添加包含在已安装软件包之一中的模块。
我需要将 "bower_components/highcharts-release/modules/funnel.js" 添加到串联的 scripts.js 文件中。
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
... More bower packages
<script src="bower_components/highcharts-release/highcharts.js"></script>
<script src="bower_components/highcharts-release/highcharts-more.js"></script>
<script src="bower_components/highcharts-release/modules/exporting.js"></script>
<script src="bower_components/highcharts-ng/dist/highcharts-ng.js"></script>
// Can't add modules/funnel.js as this block is automatically generated.
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
... App scripts
<script src="scripts/app.js"></script>
<script src="bower_components/highcharts-release/modules/funnel.js"></script>
...
<!-- endbuild -->
这不起作用,modules/funnel.js 文件未包含在 scripts.js 缩小版本中。
我应该在哪里添加依赖?
grunt-wiredep 插件会自动注入存在于项目 bower.json 依赖项 bower.json 文件
主块中的文件
因此您需要转到 bower_components/highcharts-release/
文件夹并在 bower.json
主块中添加 modules/funnel.js
文件
"main": [
"highcharts.js",
"highcharts-more.js",
"modules/exporting.js",
"modules/funnel.js"
]
我最终添加了一个新的 usemin 块:
<!-- build:js(.) scripts/modules.js -->
<script src="bower_components/highcharts-release/modules/funnel.js"></script>
<!-- endbuild -->
我无法添加包含在已安装软件包之一中的模块。
我需要将 "bower_components/highcharts-release/modules/funnel.js" 添加到串联的 scripts.js 文件中。
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
... More bower packages
<script src="bower_components/highcharts-release/highcharts.js"></script>
<script src="bower_components/highcharts-release/highcharts-more.js"></script>
<script src="bower_components/highcharts-release/modules/exporting.js"></script>
<script src="bower_components/highcharts-ng/dist/highcharts-ng.js"></script>
// Can't add modules/funnel.js as this block is automatically generated.
<!-- endbower -->
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
... App scripts
<script src="scripts/app.js"></script>
<script src="bower_components/highcharts-release/modules/funnel.js"></script>
...
<!-- endbuild -->
这不起作用,modules/funnel.js 文件未包含在 scripts.js 缩小版本中。
我应该在哪里添加依赖?
grunt-wiredep 插件会自动注入存在于项目 bower.json 依赖项 bower.json 文件
主块中的文件因此您需要转到 bower_components/highcharts-release/
文件夹并在 bower.json
主块中添加 modules/funnel.js
文件
"main": [
"highcharts.js",
"highcharts-more.js",
"modules/exporting.js",
"modules/funnel.js"
]
我最终添加了一个新的 usemin 块:
<!-- build:js(.) scripts/modules.js -->
<script src="bower_components/highcharts-release/modules/funnel.js"></script>
<!-- endbuild -->