diff --git a/README.md b/README.md index 0e7e43e..6e4c359 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,13 @@ Sets how globs are matched, either the module file path, or the `import()` speci ``` **default** `'ignore'` +_Note, this option is only applied when `mode` is `parser`._ + _Note, this option only considers block comments that precede the dynamic imports specifier, and any comments coming after are ignored and left intact._ -Sets how dynamic imports with block comments are handled. If `ignore` is used, then it will be skipped and no magic comments from your configuration will be applied. If `replace` is used, then all found comments will be replaced with the magic comments. `append` and `prepend` add the magic comments before, or after the found comments, respectively. If a function is used it will be passed the found comments, and the magic comment string that is to be applied. The return value has the same effect as `replace`. +Sets how dynamic imports with block comments are handled. If `ignore` is used, then it will be skipped and no magic comments from your configuration will be applied. If `replace` is used, then all found comments will be replaced with the magic comments. `append` and `prepend` add the magic comments after, or before the found comments, respectively. + +When a function is used it will be passed the found comments, and the magic comment string that is to be applied. The return value has the same effect as `replace`. There is an [example of using a function](https://github.com/morganney/magic-comments-loader/blob/main/__tests__/loader.spec.js#L1137-L1154) in the loader specification. ## Examples diff --git a/package-lock.json b/package-lock.json index f9daa70..f06b0dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "magic-comments-loader", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "magic-comments-loader", - "version": "2.1.0", + "version": "2.1.1", "license": "MIT", "dependencies": { "acorn": "^8.9.0", diff --git a/package.json b/package.json index e9e852d..1ae32e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magic-comments-loader", - "version": "2.1.0", + "version": "2.1.1", "description": "Add webpack magic comments to your dynamic imports at build time.", "main": "dist", "type": "module",