我正在使用grunt-babel将ES6转换为ES5.我的文件名之一是app.collection.js,在运行任务后,将其重命名为app.js.
什么是解决此问题的babel选项.
/****************************************************************************
* Grunt Babel Compile ES6 to ES5
****************************************************************************/
babel: {
options: {
blacklist: ['strict'],
comments: true,
loose: ["es6.classes", "es6.properties.computed"],
"ignore": [
]
},
dist: {
files: [{ // Dictionary of files
expand: true,
cwd: '<%= config.path.app.js %>',
src: ['**/**/*.js'],
dest: '<%= config.path.app.js %>',
ext: '.js'
}]
}
}Run Code Online (Sandbox Code Playgroud)
您可以ext完全删除该属性,也可以添加extDot值为last的属性以保留app.collection.js名称.
files: [{ // Dictionary of files
expand: true,
cwd: '<%= config.path.app.js %>',
src: ['**/**/*.js'],
dest: '<%= config.path.app.js %>',
ext: '.js',
extDot: 'last'
}]
Run Code Online (Sandbox Code Playgroud)
有关动态构建文件对象的更多信息,请访问@ gruntjs.com
extDot用于指示指示扩展名的句点所在的位置.可以采用'first'(扩展名在文件名中的第一个句点之后开始)或'last'(扩展名在最后一个句点之后开始),并且默认设置为'first'[在0.4.3中添加]
| 归档时间: |
|
| 查看次数: |
232 次 |
| 最近记录: |