JSPM

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

Find and add loader to webpack config

Package Exports

  • @ices/use-loader
  • @ices/use-loader/dist/index.js

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 { addLoaderBefore, addLoaderAfter, addLoader, findLoader } = require('@ices/use-loader')

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

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

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

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

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

API

See dist/index.d.ts