<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Mojolicious::Plugin::Browserify - An Mojolicious plugin for
    assetpack+browserify

VERSION
    0.05

DESCRIPTION
    Mojolicious::Plugin::Browserify is a plugin that will register
    Mojolicious::Plugin::Browserify::Processor in
    Mojolicious::Plugin::AssetPack.

    browserify &lt;http://browserify.org/&gt; is a JavaScript preprocessor which
    will allow you to use commonjs
    &lt;http://nodejs.org/docs/latest/api/modules.html#modules_modules&gt;'s
    "require()" in your JavaScript files. Here is an example JavaScript
    file, that use "require()" to pull in React
    &lt;http://facebook.github.io/react&gt;:

      var React = require('react');

      module.exports = React.createClass({
        render: function() {
          return &lt;div className="Bio"&gt;&lt;p className="Bio-text"&gt;{this.props.text}&lt;/p&gt;&lt;/div&gt;;
        }
      });

SYNOPSIS
      use Mojolicious::Lite;
      plugin "Browserify" =&gt; {
        browserify_args =&gt; [-g =&gt; "reactify"],
        environment =&gt; app-&gt;mode, # default
        extensions =&gt; [qw( js jsx )], # default is "js"
      };
      app-&gt;asset("app.js" =&gt; "/js/main.js");

      get "/app" =&gt; "app_js_inlined";
      app-&gt;start;

      __DATA__
      @@ app_js_inlined.js.ep
      %= asset "app.js" =&gt; {inline =&gt; 1}

    Note! The SYNOPSIS require both "react" and "reactify" to be installed:

      $ cd /home/projects/my-project
      $ mojo browserify install react
      $ mojo browserify install reactify

DEPENDENCIES
    *   browserify

        This module require browserify &lt;http://browserify.org/&gt; to be
        installed. The node based application can either be installed system
        wide or locally to your project. To install it locally, you can use
        the browserify Mojolicious command:

          # same as "npm install browserify"
          $ mojo browserify install

        It is also possible to check installed versions using this command:

          $ mojo browserify version

    *   uglifyjs

        uglifyjs &lt;https://github.com/mishoo/UglifyJS2&gt; is a really good
        minifier. The test "react.t" used to create a bundle that took 324K
        with JavaScript::Minifier::XS. With "uglifyjs" the same code takes
        "156K".

        What is the drawback? It takes a lot longer to run "uglifyjs", but
        it's worth it, since it will only be called in production mode. Get
        it with this command:

          $ mojo browserify install uglify-js

METHODS
  register
    Used to register Mojolicious::Plugin::Browserify::Processor in the
    "Mojolicious" application.

COPYRIGHT AND LICENSE
    Copyright (C) 2014, Jan Henning Thorsen

    This program is free software, you can redistribute it and/or modify it
    under the terms of the Artistic License version 2.0.

AUTHOR
    Jan Henning Thorsen - "jhthorsen@cpan.org"

</pre></body></html>