string-replace-webpack-plugin

WebJar for string-replace-webpack-plugin

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

string-replace-webpack-plugin
Последняя версия

Последняя версия

0.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

string-replace-webpack-plugin
WebJar for string-replace-webpack-plugin
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/jamesandersen/string-replace-webpack-plugin

Скачать string-replace-webpack-plugin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/string-replace-webpack-plugin/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>string-replace-webpack-plugin</artifactId>
    <version>0.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/string-replace-webpack-plugin/
implementation 'org.webjars.npm:string-replace-webpack-plugin:0.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/string-replace-webpack-plugin/
implementation ("org.webjars.npm:string-replace-webpack-plugin:0.1.3")
'org.webjars.npm:string-replace-webpack-plugin:jar:0.1.3'
<dependency org="org.webjars.npm" name="string-replace-webpack-plugin" rev="0.1.3">
  <artifact name="string-replace-webpack-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='string-replace-webpack-plugin', version='0.1.3')
)
libraryDependencies += "org.webjars.npm" % "string-replace-webpack-plugin" % "0.1.3"
[org.webjars.npm/string-replace-webpack-plugin "0.1.3"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.webjars.npm : loader-utils jar [0.2.3,0.3)
org.webjars.npm : async jar [0.2.10,0.3)
org.webjars.npm : css-loader Необязательный jar [0.9.1,0.10)
org.webjars.npm : file-loader Необязательный jar [0.8.1,0.9)
org.webjars.npm : style-loader Необязательный jar [0.8.3,0.9)

Модули Проекта

Данный проект не имеет модулей.

string replace plugin for webpack

Usage example

var StringReplacePlugin = require("string-replace-webpack-plugin");
module.exports = {
   module: {
      loaders: [
         // configure replacements for file patterns
         { 
            test: /index.html$/,
            loader: StringReplacePlugin.replace({
                replacements: [
                    {
                        pattern: /<!-- @secret (\w*?) -->/ig,
                        replacement: function (match, p1, offset, string) {
                            return secrets.web[p1];
                        }
                    }
                ]})
            }
      ]
   },
   plugins: [
      // an instance of the plugin must be present
      new StringReplacePlugin()
   ]
}

This allows for arbitrary strings to be replaced as part of the module build process. The original intent is to replace API keys in modules prior to deployment.

API

StringReplacePlugin.replace([nextLoaders: string], options, [prevLoaders: string])
  • nextLoaders loaders to follow the replacement
  • options
    • replacements disables the plugin
  • prevLoaders loaders to apply prior to the replacement

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Версии библиотеки

Версия
0.1.3