JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 129246
  • Score
    100M100P100Q41772F

Package Exports

  • rollup-plugin-replace

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 (rollup-plugin-replace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

rollup-plugin-replace

Replace strings in files while bundling them.

Installation

npm install --save-dev rollup-plugin-replace

Usage

import { rollup } from 'rollup';
import replace from 'rollup-plugin-replace';

rollup({
  entry: 'main.js',
  plugins: [
    replace({
      ENVIRONMENT: JSON.stringify( 'production' )
    })
  ]
}).then(...)

Options

{
  // a minimatch pattern, or array of patterns, of files that
  // should be processed by this plugin (if omitted, all files
  // are included by default)...
  include: 'config.js',

  // ...and those that shouldn't, if `include` is otherwise
  // too permissive
  exclude: 'node_modules/**',

  // To replace every occurence of `<@foo@>` instead of every
  // occurence of `foo`, supply delimiters
  delimiters: [ '<@', '@>' ],

  // All other options are treated as `string: replacement`
  // replacers...
  VERSION: '1.0.0',
  ENVIRONMENT: JSON.stringify( 'development' ),

  // ...unless you want to be careful about separating
  // values from other options, in which case you can:
  values: {
    VERSION: '1.0.0',
    ENVIRONMENT: JSON.stringify( 'development' )
  }
}

License

MIT