Skip to content

Commit

Permalink
docs: update github syntax of warning (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
ersachin3112 committed Jun 10, 2024
1 parent 6822dd0 commit 44aeae3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Useful when a source file does not contain exports or something does not export.

For further hints on compatibility issues, check out [Shimming](https://webpack.js.org/guides/shimming/) of the official docs.

> **Warning**
> [!WARNING]
>
> By default loader generate ES module named syntax.
> **Warning**
> [!WARNING]
>
> Be careful, existing exports (`export`/`module.exports`/`exports`) in the original code and exporting new values can cause a failure.
Expand Down Expand Up @@ -52,7 +52,7 @@ pnpm add -D exports-loader
The `|` or `%20` (space) allow to separate the `syntax`, `name` and `alias` of export.
The documentation and syntax examples can be read [here](#syntax).

> **Warning**
> [!WARNING]
>
> `%20` is space in a query string, because you can't use spaces in URLs
Expand Down Expand Up @@ -290,11 +290,11 @@ Examples:
- `[multiple Foo FooA]` - generates `module.exports = { 'FooA': Foo };`.
- `[named [name] [name]Alias]` - generates ES module named exports and exports a value equal to the filename under other name., for `single.js` it will be `single` and `singleAlias`, generates `export { single as singleAlias };`.

> **Warning**
> [!WARNING]
>
> You need to set `type: "commonjs"` to use `single` or `multiple` syntaxes.
> **Warning**
> [!WARNING]
>
> Aliases can't be used together with `default` or `single` syntaxes.
Expand Down Expand Up @@ -574,15 +574,15 @@ module.exports = { FooA: Foo };

Allow to specify multiple exports. Each item can be a [`string`](https://github.com/webpack-contrib/exports-loader#string) or an [`object`](https://github.com/webpack-contrib/exports-loader#object).

> **Warning**
> [!WARNING]
>
> Not possible to use `single` and `multiple` syntaxes together due to CommonJS format limitations.
> **Warning**
> [!WARNING]
>
> Not possible to use multiple `default` values due to ES module format limitations.
> **Warning**
> [!WARNING]
>
> Not possible to use multiple `single` values due to CommonJS format limitations.
Expand Down

0 comments on commit 44aeae3

Please sign in to comment.