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

chore: bump interpret for .mjs support #1728

Closed
wants to merge 2 commits into from

Conversation

anshumanv
Copy link
Member

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
Member Author

/cc @evilebottnawi

@alexander-akait
Copy link
Member

Fail 😕

@anshumanv
Copy link
Member Author

Fail 😕

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

@alexander-akait
Copy link
Member

WIP on terser

snitin315
snitin315 previously approved these changes Aug 5, 2020
Copy link
Member

@alexander-akait alexander-akait left a comment

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
Member Author

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

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

Could you rebase?

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

needs rebase

Copy link
Member

@evenstensberg evenstensberg left a comment

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
Member

@anshumanv high priority before release, thanks for helping

@anshumanv
Copy link
Member Author

yes today 👍

@evenstensberg
Copy link
Member

Nice

@anshumanv
Copy link
Member 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
Member

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

Copy link
Member

@evenstensberg evenstensberg left a comment

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

@anshumanv Thanks for your update.

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

@evenstensberg Please review the new changes.

Copy link
Member

@alexander-akait alexander-akait left a comment

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
Copy link
Member

alexander-akait commented Sep 2, 2020

@alexander-akait
Copy link
Member

@rishabh3112
Copy link
Member

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
Member 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