Skip to content

Add webpack 5 import instructions to readme#240

Open
Yahav wants to merge 1 commit into
PaperStrike:mainfrom
Yahav:patch-3
Open

Add webpack 5 import instructions to readme#240
Yahav wants to merge 1 commit into
PaperStrike:mainfrom
Yahav:patch-3

Conversation

@Yahav

@Yahav Yahav commented Nov 22, 2021

Copy link
Copy Markdown
Contributor

to address the following:
#239

@PaperStrike PaperStrike left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! 👍

Comment thread README.md
import Pjax from './dist/pjax.esm.js';
```

##### To import as ES module with Webpack 5 bundler

@PaperStrike PaperStrike Nov 22, 2021

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to not only webpack 5, but any tool that can parse the exports field well, so it's better if you widen that description. And import it this way is actually preferred, so the description could be like:

# Pick a script in `dist` folder

## Automatic Pick

[[description]]

<script src="@sliphua/pjax"></script>

or

import Pjax from '@sliphua/pjax';

## To declare globally

…

## To import as ES module

…

@PaperStrike PaperStrike added bug Something isn't working documentation Improvements or additions to documentation labels Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module not found: Error: Package path ./dist/pjax.esm.js is not exported from package

2 participants