diff options
Diffstat (limited to 'webpack/loaders')
| -rw-r--r-- | webpack/loaders/replace.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/webpack/loaders/replace.js b/webpack/loaders/replace.js index 0326dcdab3..d8a81c245a 100644 --- a/webpack/loaders/replace.js +++ b/webpack/loaders/replace.js @@ -1,12 +1,12 @@ -const loaderUtils = require('loader-utils'); +import { getOptions } from 'loader-utils'; function trim(text, g) { return text.substring(1, text.length - (g ? 2 : 0)); } -module.exports = function(src) { +export default function(src) { this.cacheable(); - const options = loaderUtils.getOptions(this); + const options = getOptions(this); const search = options.search; const g = search[search.length - 1] == 'g'; const file = this.resourcePath.replace(/\\/g, '/'); @@ -19,4 +19,4 @@ module.exports = function(src) { src = src.replace(new RegExp(trim(search, g), g ? 'g' : ''), replace); this.callback(null, src); return src; -}; +} |