JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q46276F
  • License MIT

Find and add loader to webpack config

Package Exports

  • @ices/use-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ices/use-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@ices/use-loader

Usage

const { addBefore, addAfter, add, find } = require('@ices/use-loader')

// find file-loader
const matched = find(webpackConfig, 'file-loader')

// add new loader config to the slibing position after the file-loader
add(webpackConfig, 'file-loader', newRuleConfig, (index) => index + 1)

// add new loader config to the slibing position before the file-loader
addBefore(webpackConfig, 'file-loader', newRuleConfig)

// add new loader config to the slibing position after the file-loader
addAfter(webpackConfig, 'file-loader', newRuleConfig)

// use customize matcher
find(webpackConfig, ({ name }) => name === 'file-loader')

API

See dist/index.d.ts