javascript - How copy mains file to specific folder with Grunt -
my .bowerrc this:
{ "directory": "components", "strict-ssl": true }
in bower.json have:
"dependencies": { "jquery": "~2.1.1", "bootstrap": "~3.3.1" }
when run bower install, downloads jquery , bootstrap components folder.
i'm trying using grunt generate structure below, but, i'm not find plugin this.
build / js/jquery.min.js js/bootstrap.min.js css/bootstrap.min.css fonts/glyphicons-halflings-regular.eot fonts/glyphicons-halflings-regular.svg fonts/glyphicons-halflings-regular.ttf fonts/glyphicons-halflings-regular.woff
after copy these files, want zip (i know how step) content inside build folder.
you can use grunt-bower-taks achieve this. task take care of downloading files using bower , placing them in structure require.
need specify custom layout match folder structure require. done adding custom layout function part of task options:
module.exports = function(grunt) { // project configuration. grunt.initconfig({ bower: { install: { options: { targetdir: "./build", verbose: true, layout: function(type, component, source) { return type; } } } } }); grunt.loadnpmtasks('grunt-bower-task'); };
since want want more "main" files, need add exportsoverride
section bower.json:
"exportsoverride": { "jquery": { "js": "dist/*.js" }, "bootstrap": { "js": "dist/js/*.js", "css" : "dist/css/*.css", "fonts" : "dist/fonts/*.*" } }
Comments
Post a Comment