Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vrbo/nimbuild-webpack

Package Overview
Dependencies
Maintainers
9
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vrbo/nimbuild-webpack

Library that provides nimbuild webpack bundling at runtime

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created
Source

@vrbo/nimbuild-webpack

NPM Version Build Status

Library that provides nimbuild webpack bundling at runtime

Installation

npm install --save @vrbo/nimbuild-webpack

Usage

Import module and instantiate new class instance:

const webpacknimbuild = require('@vrbo/nimbuild-webpack')({
    webpackConfig: {...}, // customize webpack compiler
    maxEntries: 100 // defaults to 0 for infinity
});

Get bundle string:

async function getBundleString() {
    const response = await webpacknimbuild.run({
        entry: ['react', 'react-dom'],
        minify: true,
        modifyScript: (script) => {
            // Optionally wrap response
            return `!function (undefined) { 'use strict'; ${script} }();`;
        }
    });
    return response.script; // contains string value of bundle
}

Getting / Setting Cache:

// Get serialized cache
const serializedData = webpacknimbuild.serializeCache();

// Set cache from serialized data
webpacknimbuild.deserializeCache(serializedData);

Configure nimbuild-webpack to handle ES6+ source code

const webpacknimbuild = require('@vrbo/nimbuild-webpack')({
    webpackConfig: {
        module: {
            rules: [
                {
                    test: /\.js$/,
                    loader: 'babel-loader'
                }
            ]
        }
    }
});

Development

Starting development harness

npm start

Prettier

This projects supports auto-formatting of source code! Simply find your favorite IDE from the list in the following list: https://prettier.io/docs/en/editors.html

For VSCode support, perform the following steps:

  • Launch VS Code Quick Open (Ctrl+P)
  • Paste the following command, and press enter:
ext install esbenp.prettier-vscode

Keywords

FAQs

Package last updated on 27 Feb 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc