目前我有一些看起来像这样的 html 文件:
<!-- build:js({.tmp,app}) scripts/moduleX-scripts.js -->
<script src="scripts/moduleX/moduleXConfig.js"></script>
<script src="scripts/moduleX/featureX/controller.js"></script>
<script src="scripts/moduleX/featureX/service.js"></script>
<script src="scripts/moduleX/featureY/controller.js"></script>
<script src="scripts/moduleX/featureY/service.js"></script>
<!-- endbuild -->
<!-- build:js({.tmp,app}) scripts/moduleY-scripts.js -->
<script src="scripts/moduleY/moduleYConfig.js"></script>
<script src="scripts/moduleY/featureW/controller.js"></script>
<script src="scripts/moduleY/featureW/service.js"></script>
<script src="scripts/moduleY/featureZ/controller.js"></script>
<script src="scripts/moduleY/featureZ/service.js"></script>
<!-- endbuild -->
由于这是一个角度应用程序,我想使用ocLazyLoad来管理我的模块,所以我的配置看起来像这样:
angular.module('MyMainModule', [
{
name: 'moduleX',
files: [
'scripts/moduleX/moduleXConfig.js',
'scripts/moduleX/featureX/controller.js',
'scripts/moduleX/featureX/service.js',
'scripts/moduleX/featureY/controller.js',
'scripts/moduleX/featureY/service.js',
]
},
{
name: 'moduleY',
files: [
'scripts/moduleY/moduleYConfig.js',
'scripts/moduleY/featureW/controller.js',
'scripts/moduleY/featureW/service.js',
'scripts/moduleY/featureZ/controller.js',
'scripts/moduleY/featureZ/service.js',
]
}
])
是否有任何 grunt 插件可以处理这个 .js 文件并files
用缩小和修订版本替换数组?