Skip to content

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! 👍

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