javascript - grunt prompts that there are missing brackets, but there are no missing brackets (solved, semicolon does not have Baidu and thinks it is a semicolon, but it turns out to be a semicolon)
大家讲道理
大家讲道理 2017-05-18 10:46:02
0
1
313

Gruntfile.js

module.exports = function(grunt){ //任务配置 grunt.initConfig({ pkg:grunt.file.readJSON('package.json'), uglify:{ //options配置允许生成的压缩文件带banner options:{ stripBanners:true, banner:'/*! <%=pkg.name%>-<%=pkg.version%>.js.min.js <%= grunt.template.today("yyyy-mm-dd")%> */\n' }, //build 配置源文件和目标文件 build:{ src:'src/test.js', dest:'build/<%=pkg.name%>-<%=pkg.version%>.js.min.js' } }, jshint:{ //表明要检测什么js文档的语法 build:['Gruntfile.js','src/*.js'], //通过什么语法规则检查语法 options:{ jshintrc:'.jshintrc' } } }); //告诉grunt将使用插件 grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); //告诉grunt在终端输入grunt时需要做什么 grunt.registerTask('default',['jshint','uglify']); }//line 37

package.json

{ "name": "grunt_test", "version": "1.0.0", "devDependencies": { "grunt": "^1.0.1", "grunt-contrib-jshint": "^1.1.0", "grunt-contrib-uglify": "^3.0.0" } }

After adding curly braces:

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (1)
给我你的怀抱

You should mark the line corresponding to line 37 of your code, otherwise no one will know which line is line 37

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!