Skip to content

Module execution order can be incorrect when having multiple entrypoints #5423

@sapphi-red

Description

@sapphi-red

Rollup Version

4.12.1

Operating System (or Browser)

StackBlitz / REPL

Node Version (if applicable)

No response

Link To Reproduction

Expected Behaviour

// main.js
import './1-hash.js'
import './2-hash.js'
import './3-hash.js'

// sub.js
import './1-hash.js'
import './3-hash.js'

// 1-hash.js
console.log('1');

// 2-hash.js
console.log('2');

// 3-hash.js
console.log('3');

Actual Behaviour

// main.js
import './3-hash.js'

console.log('2');

// sub.js
import './3-hash.js'

// 3-hash.js
console.log('1');

console.log('3');

Additional Information

Maybe this is a duplicate of #3888. I made a different issue as this might be easier to fix than the repro in #3888. Feel free to close this one if it's better to be merged in to #3888.

refs vitejs/vite#7168, vitejs/vite#6375

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions