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

spawn-loader

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spawn-loader

Webpack loader to spawn a new entry chunk.

latest
Source
npmnpm
Version
7.0.2
Version published
Weekly downloads
49
-56.25%
Maintainers
1
Weekly downloads
 
Created
Source

spawn-loader

Webpack loader to spawn a new entry chunk.

A fork of entry-loader, with a few changes:

  • Gives descriptive names to the chunk and child compiler.

  • Adds a path option to output files to a subdirectory.

Installation

npm install --save-dev spawn-loader

Usage

// simplest usage: emits otherBundle.js in the same directory
var url = require('spawn-loader!./otherBundle');
// url === 'otherBundle.js'

// build into a subdir: emits otherBundle.js
// (and any assets it emits) into childDir/
var url = require('spawn-loader?path=childDir!./otherBundle');
// url === 'childDir/otherBundle.js'

// specify a different name
var url = require('spawn-loader?name=bundle.js!./file');
// url === 'bundle.js'

// emit the required file as-is, with no prelude
// only useful in combination with other loaders
var url = require('spawn-loader?inert!./manifest.json');
// url === 'manifest.json'

webpack.config.js Options

file.js

import React from 'react';

webpack.config.js

// ...
{
  loader: 'spawn-loader',
  options: {
    // add plugins to the child compiler
    plugins: [new webpack.ExternalsPlugin('var', { react: 'React' })]
  }
}

Keywords

webpack

FAQs

Package last updated on 24 Oct 2021

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