Skip to content
This repository was archived by the owner on Jun 11, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (46 loc) · 708 Bytes

replace.md

File metadata and controls

50 lines (46 loc) · 708 Bytes

Replace Plugin

A plugin that you can use to replace strings in your code.

Usage

Setup

Import ReplacePlugin

const {
  start,
  builtInPlugins: {
    ReplacePlugin
  }
} = require('reboost');

Add it to the plugins array

const {
  start,
  builtInPlugins: {
    ReplacePlugin
  }
} = require('reboost');

start({
  plugins: [
    ReplacePlugin({
      'to-replace': 'replacement'
    })
  ]
})

Example

If you want to replace process.env.NODE_ENV with production

const {
  start,
  builtInPlugins: {
    ReplacePlugin
  }
} = require('reboost');

start({
  plugins: [
    ReplacePlugin({
      'process.env.NODE_ENV': JSON.stringify('production')
    })
  ]
})