The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dist::Zilla::Plugin::Web::Bundle - Bundle the library files into "tasks", using information from components.json

VERSION

version 0.0.10

SYNOPSIS

In your dist.ini:

[NPM::Bundle]
filename = components.json ; default

In your components.json:

{
    
    Core : {
        contains    : [
            "KiokuJS.Reference",
            
            "KiokuJS.Exception",
            "KiokuJS.Exception.Network",
            "KiokuJS.Exception.Format",
            "KiokuJS.Exception.Overwrite",
            "KiokuJS.Exception.Update",
            "KiokuJS.Exception.Remove",
            "KiokuJS.Exception.LookUp",
            "KiokuJS.Exception.Conflict"
        ],
    }
    
    
    Prereq : {
        
        contains    : [
            "node_modules/task-joose-stable/joose-stable.js",
            "node_modules/joosex-attribute/joosex-attribute.js"
        ],
    },
    
    
    All : {
        saveAs      : 'kiokujs-all.js',
        
        contains    : [
            "+Core",
            "+Prereq"
        ]
    },
    
    
    AllMin : {
        saveAs      : 'kiokujs-all-min.js',
        
        minify      : 'yui',
        
        contains    : [
            "+All"
        ]
    }
} 

DESCRIPTION

This plugins concatenates several source files into single bundle using the information from components.json file.

This files contains a simple JavaScript assignment (to allow inclusion via <script> tag) of the JSON structure.

First level entries of the JSON structure defines a bundles. Each bundle is an array of entries.

Entry, starting with the "+" prefix denotes the content of another bundle.

All other entries denotes the javascript files from the "lib" directory. For example entry "KiokuJS.Reference" will be fetched as the content of the file "lib/KiokuJS/Reference.js"

All bundles are stored as "lib/Task/Distribution/Name/BundleName.js", assuming the name of the distrubution is "Distribution-Name" and name of bundle - "BundleName". During release, all bundles also gets added to the root of distribution as "task-distribution-name-bundlename.js". To enable the latter feature for regular builds add the `roots_only_for_release = 0` config option

AUTHOR

Nickolay Platonov <nplatonov@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Nickolay Platonov.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.