New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

system-smart

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

system-smart

Smart bundle genrator for systemjs/builder

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

system-smart

Smart bundle genrator for systemjs/builder

Use

Generate smart bundles


    var Builder = require('systemjs-builder');
    require('system-smart');

    var builder = new Builder(/* ... */);

    builder
        .smart(['entrypoint-a.js', 'entrypoint-b.js' /* , 'other entrypoints'*/], './dist')
        .then(result => {
            // result =
            [
                { // entrypoint-a.js
                    hash: '[SHA1]', // content hash
                    name: '[SHA1].bundle.js', // output filename
                    path: '/path/to/dist/[SHA1].bundle.js', // output dest
                    source: '...',
                    sourceMap: '...',
                    modules: [ 'entrypoint-a.js', /* depencies */ ]
                },
                { // entrypoint-b.js
                    hash: '[SHA1]', // content hash
                    name: '[SHA1].bundle.js', // output filename
                    path: '/path/to/dist/[SHA1].bundle.js', // output dest
                    source: '...',
                    sourceMap: '...',
                    modules: [ 'entrypoint-b.js', /* depencies */ ]
                },
                { // Smart bundles
                    hash: '[SHA1]', // content hash
                    name: '[SHA1].bundle.js', // output filename
                    path: '/path/to/dist/[SHA1].bundle.js', // output dest
                    source: '...',
                    sourceMap: '...',
                    modules: [ /* commond depencies */ ]
                },
                // More smart bundles
            ]
        })

Add bundles to systemjs configuration


    javascript
    SystemJS.config({
        bundles: {
            'dist/[SHA1].bundle.js': [ 'entrypoint-a.js', /* depencies */ ],
            'dist/[SHA1].bundle.js': [ 'entrypoint-b.js', /* depencies */ ],
            'dist/[SHA1].bundle.js': [ /* commond depencies */ ],
            // [outputDir + result.name]: result.modules
        }
    });

Keywords

systemjs

FAQs

Package last updated on 08 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts