https://github.com/shian15810/entry-chunk-loader
Webpack loader to generate a new entry chunk.
https://github.com/shian15810/entry-chunk-loader
chunk entry loader webpack
Last synced: 2 months ago
JSON representation
Webpack loader to generate a new entry chunk.
- Host: GitHub
- URL: https://github.com/shian15810/entry-chunk-loader
- Owner: shian15810
- License: mit
- Created: 2020-10-30T15:22:26.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-16T16:15:32.000Z (over 2 years ago)
- Last Synced: 2024-11-17T00:39:49.496Z (11 months ago)
- Topics: chunk, entry, loader, webpack
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/entry-chunk-loader
- Size: 1.24 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# entry-chunk-loader
Webpack loader to generate a new entry chunk.
A fork of [`spawn-loader`](https://github.com/erikdesjardins/spawn-loader), with a few notable changes:
- Supports [Webpack 5](https://webpack.js.org/blog/2020-10-10-webpack-5-release/).
- Supports native [ECMAScript modules](https://nodejs.org/api/esm.html) of Node.js.## Installation
`npm install --save-dev entry-chunk-loader`
## Usage
### ECMAScript modules
```js
// simplest usage: emits otherBundle.js in the same directory
import url from 'entry-chunk-loader!./otherBundle');
// url === 'otherBundle.js'// build into a subdir: emits otherBundle.js
// (and any assets it emits) into childDir/
import url from 'entry-chunk-loader?path=childDir!./otherBundle';
// url === 'childDir/otherBundle.js'// specify a different name
import url from 'entry-chunk-loader?name=bundle.js!./file';
// url === 'bundle.js'// emit the required file as-is, with no prelude
// only useful in combination with other loaders
import url from 'entry-chunk-loader?inert!./manifest.json';
// url === 'manifest.json'
```### CommonJS modules
```js
// simplest usage: emits otherBundle.js in the same directory
const url = require('entry-chunk-loader!./otherBundle');
// url === 'otherBundle.js'// build into a subdir: emits otherBundle.js
// (and any assets it emits) into childDir/
const url = require('entry-chunk-loader?path=childDir!./otherBundle');
// url === 'childDir/otherBundle.js'// specify a different name
const url = require('entry-chunk-loader?name=bundle.js!./file');
// url === 'bundle.js'// emit the required file as-is, with no prelude
// only useful in combination with other loaders
const url = require('entry-chunk-loader?inert!./manifest.json');
// url === 'manifest.json'
```