Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webpack 5 import instructions to readme #240

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Yahav
Copy link
Contributor

@Yahav Yahav commented Nov 22, 2021

to address the following:
#239

Copy link
Owner

@PaperStrike PaperStrike left a comment

Choose a reason for hiding this comment

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

Good catch! 👍

@@ -65,6 +65,12 @@ Import the default value from `pjax.esm.js` or `pjax.esm.min.js` as:
import Pjax from './dist/pjax.esm.js';
```

##### To import as ES module with Webpack 5 bundler
Copy link
Owner

@PaperStrike PaperStrike Nov 22, 2021

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