Answer the question
In order to leave comments, you need to log in
How to configure wiredep and usemin?
I want to use bower to automatically add compressed css and js files to the project when installing the package. Can't setup given task in grunt js:
Gruntfile:
wiredep: {
app: {
src: 'dest/*.php'
}
},
// end wiredep
useminPrepare: {
html: 'dest/*.php',
options: {
dest: 'dest',
flow: {
html: {
steps: {
js: ['concat', 'uglifyjs'],
css: ['cssmin']
},
post: {}
}
}
}
},
// end useminPrepare
usemin: {
html: ['index.php'],
css: ['index.php'],
js: ['index.php']
},
CSS:
<!-- build:css dest/styles/vendor.css -->
<!-- bower:css -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:css dest/styles/main.css -->
<!-- endbuild -->
JS:
<!-- build:js dest/scripts/vendor.js -->
<!-- bower:js -->
<!-- endbower -->
<!-- endbuild -->
<!-- build:js dest/scripts/scripts.js -->
<!-- endbuild -->
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question