How to configure Grunt to replace Bower dependencies by its minified versions

后端 未结 4 1937
栀梦
栀梦 2020-12-12 18:09

I am new to Yeoman/Grunt/Bower. I have a bower.json file that defines the following dependencies:

bower.json

{
    \"         


        
4条回答
  •  [愿得一人]
    2020-12-12 19:09

    don't need to change the html, try grunt-contrib-uglify

    uglify: {
      libs: {
        files: [
          {
            expand: true,
            cwd: 'components',
            src: '**/*.js',
            dest: 'build/components'
          }
        ]
      }
    }
    

    and if the file are requested more the one page, it will be cached by the browser, it will be load faster than the combined larger file.

提交回复
热议问题