I've tried following you're instructions by using an assets.json and creating a grunt.js file but whenever I switch my app to production mode, it's referencing the built folder but there's actually nothing in it.
{
"main": {
"css": {
"public/compiled/css/app.css": [
"public/foundation/css/webfonts/font-awesome-4.3.0/css/font-awesome.min.css",
"public/javascripts/angularjs/angular-ui-tree-master/dist/angular-ui-tree.min.css",
"public/javascripts/angularjs/angular-tablesort-master/tablesort.css",
"public/javascripts/angularjs/datatables/css/datatables.css",
"public/javascripts/angularjs/dropzone-master/dist/dropzone.css",
"public/javascripts/angularjs/dropzone-master/dist/basic.css",
"public/javascripts//toastr-master/toastr.css",
"public/javascripts/angularjs/sweetalert-master/lib/sweet-alert.css",
"public/foundation/css/app.css",
"public/javascripts/foundation-datepicker-master/stylesheets/foundation-datepicker.css"
]
},
"js": {
"public/compiled/js/app.js": [
"public/javascripts/angularjs/underscore-min.js",
"public/foundation/bower_components/modernizr/modernizr.js",
"public/foundation/bower_components/jquery/dist/jquery.min.js",
"public/javascripts/angularjs/tinymce/js/tinymce/tinymce.min.js"
]
}
}
}
My gruntfile.js, I put this in the root directory of my project (not sure where to put it):
module.exports = function (grunt) {
// Project Configuration
grunt.initConfig({
assets: grunt.file.readJSON('config/assets.json'),
uglify: {
main: {
options: {
mangle: true,
compress: true
},
files: '<%= assets.main.js %>'
}
},
cssmin: {
main: {
files: '<%= assets.main.css %>'
}
}
});
//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
//Making grunt default to force in order not to break the project.
grunt.option('force', true);
//Default task(s).
grunt.registerTask('default', ['cssmin', 'uglify']);
};
// Process your assets file
var assets = assetmanager.process({
assets: require(__dirname + '/config/assets.json'),
debug: false,
webroot: 'public'
});
Like i said everything works well in development mode, but it's not getting compiled in production mode. If I run "grunt build" in the root dir where the "gruntfile.js" is located, it returns saying "task build" not found.