Answer the question
In order to leave comments, you need to log in
How to use Bower modules with Browserify loader?
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'resources/assets/raw/css/*.css', // Все CSS файлы
],
dest: 'resources/assets/build/css/concat.style.css',
}
},
browserify: {
dist: {
options: {
transform: ["debowerify"]
},
files: {
'resources/assets/build/bundle.js': ['resources/assets/raw/js/main.js']
},
}
},
uglify: {
options: {
mangle: false
},
my_target: {
files: {
'public/js/bundle.min.js':
[
'resources/assets/build/bundle.js'
]
}
}
},
watch: {
scripts: {
files: ['resources/assets/raw/js/*.js','resources/assets/raw/css/*.css'],
tasks: ['concat','browserify','uglify'],
options: {
spawn: false,
},
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-browserify');
// Default task(s).
grunt.registerTask('dev', ['concat','browserify','uglify','watch']);
};
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