[ColdBox 4.1.0] Why jsmin is not converted to module?

Is there any reason on non converting JsMin plugin to module?

Is there a different module that we should use?

I have not converted it to a Module because I am no longer using it anymore.

But please go ahead and fork and update or I can give you access to the repo.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

I’m having issues using JSMin through cbcompat. We’re talking about building one in node and hooking it to our SVN Commit.

Out of curiosity, what are you using now Luis?

My 2 cents (even though you asked Luis, sorry): Just use Grunt or Gulp instead of reinventing the wheel, if at all possible. They are both very effective at handling minification, with a number of options, and can just run in the background while you are working.

I generally set up an application so that the development environment serves the original versions and production uses the minified ones. If you set it up right, it’s just a path prefix conditional (e.g. getSetting("environment") == 'development'):

Here’s an example Gruntfile.js uglification config, with all of the minified files being placed (recursively) in to includes/js/opt, which is the path that is used in production.

uglify: {
         viewJS: {
            options: {
            mangle: true,
            compress: true,
            // the banner is inserted at the top of the output
            banner: '/*! Copyright <%= grunt.template.today("yyyy") %> - Silo Web (Compiled: <%= grunt.template.today("dd-mm-yyyy") %>) */\n'
            },
            files: [{
              expand: true,
              cwd: 'includes/js',
              src: 'view/**/*.js',
              dest: 'includes/js/opt/'
            }]
        },
        modelJS: {
            options: {
            mangle: true,
            compress: true,
            // the banner is inserted at the top of the output
            banner: '/*! Copyright <%= grunt.template.today("yyyy") %> - Silo Web (Compiled: <%= grunt.template.today("dd-mm-yyyy") %>) */\n'
            },
            files: [{
              expand: true,
              cwd: 'includes/js',
              src: 'model/**/*.js',
              dest: 'includes/js/opt/'
            }]
        }
    }

then just watch those directories for changes and re-uglify when they do:

watch: {
    jsView: {
        files: ['includes/js/view/*.js','includes/js/view/widgets/*.js'],
        tasks: ['uglify:viewJS']
    },
    jsModel: {
        files: ['includes/js/model/*.js'],
        tasks: ['uglify:modelJS']
    }
}

We now use jons approach as well. I saw adverse side effects with minification on the fly.

Now. Since CommandBox supports modules we will move jsmin as a CommandBox module so we can do this via cli

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057

good stuff, I’m going to try the grunt solution, thanks guys!