module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
uglify: {
my_target: {
files: {
'_s/js/script.js': ['_s/components/js/*.js','_s/components/js/other.js']
}
}
}
})
}
files/
d- components
f- script.js ->
function test(){
return "Hello";
}
d- css
d- js
script.js ->
f- node_modules
f- gruntfile.js
f- index.html
package.json
我在文件_s / components / js / script.js中写,但是当我尝试在终端命令grunt uglify中打开时。我一直是这个错误
>> Destination (_s/js/script.js) not written because src files were empty.
Done, without errors.
抱歉!我决定了
files: {
'js/script.js': ['components/js/*.js']
}