Skip to content

chore: bump interpret for .mjs support#1728

Closed
anshumanv wants to merge 2 commits into
webpack:nextfrom
anshumanv:interpret-bump
Closed

chore: bump interpret for .mjs support#1728
anshumanv wants to merge 2 commits into
webpack:nextfrom
anshumanv:interpret-bump

Conversation

@anshumanv

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

chore

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
NA

Summary
Interpret has added .mjs support in latest version so bumping it then will be working on mjs support + tests

Does this PR introduce a breaking change?
No

Other information

@anshumanv

Copy link
Copy Markdown
Contributor Author

/cc @evilebottnawi

@alexander-akait

Copy link
Copy Markdown
Member

Fail 😕

@anshumanv

Copy link
Copy Markdown
Contributor Author

Fail 😕

Need update terser because a warning is coming from it which is failing the tests

@alexander-akait

Copy link
Copy Markdown
Member

WIP on terser

snitin315
snitin315 previously approved these changes Aug 5, 2020

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we add tests?

@anshumanv

Copy link
Copy Markdown
Contributor Author

Yes, running into some issue with mjs files, will update once resolved

@evenstensberg evenstensberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you rebase?

@evenstensberg evenstensberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

needs rebase

@evenstensberg evenstensberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs test & rebase

@alexander-akait

Copy link
Copy Markdown
Member

@anshumanv high priority before release, thanks for helping

@anshumanv

Copy link
Copy Markdown
Contributor Author

yes today 👍

@evenstensberg

Copy link
Copy Markdown
Member

Nice

@anshumanv

Copy link
Copy Markdown
Contributor Author

Running into little problem while adding tests for mjs config, I'm using rechoir to setup the environment and it uses require syntax to read any config format, even tried adding a package.json file with type module but seeing this 😞 @evilebottnawi @evenstensberg do you have any ideas about this?

"[webpack-cli] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/anshumanv/Code/GitHub/webpack-cli/test/config-format/mjs/webpack.config.mjs at Module.load (internal/modules/cjs/loader.js:980:11) at Function.Module._load (internal/modules/cjs/loader.js:875:14) at Module.require (internal/modules/cjs/loader.js:1022:19) at require (internal/modules/cjs/helpers.js:72:18) at ConfigGroup.requireConfig (/Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/groups/ConfigGroup.js:86:22) at ConfigGroup.resolveConfigFiles (/Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/groups/ConfigGroup.js:162:41) at ConfigGroup.run (/Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/groups/ConfigGroup.js:206:20) at WebpackCLI._handleGroupHelper (/Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/webpack-cli.js:212:46) at /Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/webpack-cli.js:245:30 at async WebpackCLI.runOptionGroups (/Users/anshumanv/Code/GitHub/webpack-cli/packages/webpack-cli/lib/webpack-cli.js:242:9) { code: 'ERR_REQUIRE_ESM' }"

@alexander-akait

Copy link
Copy Markdown
Member

@anshumanv we should use await import() to load mjs, need think how we can implement this

@evenstensberg evenstensberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you push the testcase?

@webpack-bot

Copy link
Copy Markdown

@anshumanv Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@evenstensberg Please review the new changes.

@alexander-akait alexander-akait left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We use require to load config, right?

@alexander-akait

alexander-akait commented Sep 2, 2020

Copy link
Copy Markdown
Member

@alexander-akait

Copy link
Copy Markdown
Member

Alternative solutions https://github.com/standard-things/esm

@rishabh3112

Copy link
Copy Markdown
Contributor

Update
await import() is not working as it's functionality is reverted in node.
I have created a seperate PR with esm package (which also fails locally).
These two are only options for now that I could find except using babel which is not a good idea as whole package is in cjs.

@anshumanv

Copy link
Copy Markdown
Contributor Author

Closing in favour of #1786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants