spawn-loader
Webpack loader to spawn a new entry chunk.
Last updated 18 days ago by erikdesjardins .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install spawn-loader 
SYNC missed versions from official npm registry.

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' })]
  }
}

Current Tags

  • 7.0.0                                ...           latest (18 days ago)

15 Versions

  • 7.0.0                                ...           18 days ago
  • 6.1.0                                ...           a month ago
  • 6.0.0                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 23
Dependencies (2)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |