mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
18 lines
618 B
TypeScript
18 lines
618 B
TypeScript
import StringReplacePlugin = require('string-replace-webpack-plugin');
|
|
|
|
StringReplacePlugin.replace('babel-loader', {
|
|
replacements: [
|
|
{
|
|
// Taken from:
|
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter
|
|
pattern: /([^\d]*)(\d*)([^\w]*)/,
|
|
replacement: (match, p1, p2, p3, offset, string) => {
|
|
// p1 is nondigits, p2 digits, and p3 non-alphanumerics
|
|
return [p1, p2, p3].join(' - ');
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
new StringReplacePlugin();
|