egoist / egoist/rollup-plugin-postcss

Wrong resolution order for dynamically imported modules in 3.1.6

Open
#316 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

Dynamically imported modules are sorted *before* any other entry since #295.

Let's assume an entry point `main.js`:
```js
import './styles.css'
import('./dynamic.js').then(...)
```
and a dynamically imported module `dynamic.js`:
```js
import './dynamic-styles.css`
```

Before #295 the css bundle had `styles.css` content before `dynamic-styles.css` content. Now the order is inverted.

The `moduleIds` array returned from `getRecursiveImportOrder` is missing the module ids found by using `getModuleInfo(id).dynamicallyImportedIds`. The previous definition based on `this.moduleIds` had them.

Dynamically imported modules should also have a stable order among themselves.

@wardpeet can I ask for your help?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.