-
-
Notifications
You must be signed in to change notification settings - Fork 668
feat: add mjs support #1786
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
Closed
Closed
feat: add mjs support #1786
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b4b6462
chore: bump interpret for .mjs support
anshumanv bfb3a1a
tests: add mjs tests
anshumanv 4f39a69
chore: use esm package
rishabh3112 98f0dbb
Merge branch 'next' into feat/mjs-support
rishabh3112 b03d7ee
chore: remove async
rishabh3112 a853779
chore: remove async
rishabh3112 232fe0f
Merge branch 'feat/mjs-support' of https://github.com/webpack/webpack…
rishabh3112 941016a
chore: remove comments
rishabh3112 a5a440a
chore: use import again
rishabh3112 693abcd
chore: rebase
rishabh3112 1b47e32
chore: update requireConfig
rishabh3112 251c293
chore: update requireConfigFiles
rishabh3112 ffcaaa7
chore: update extenstion check
rishabh3112 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| console.log('Hoshiumi'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| const { run } = require('../../utils/test-utils'); | ||
| const { existsSync } = require('fs'); | ||
| const { resolve } = require('path'); | ||
|
|
||
| describe('webpack cli', () => { | ||
| it('should support mjs file', () => { | ||
| const { stderr, stdout } = run(__dirname, ['-c', 'webpack.config.mjs'], false); | ||
| expect(stderr).toBeFalsy(); | ||
| expect(stdout).toBeTruthy(); | ||
| console.log({ stderr, stdout }); | ||
| expect(existsSync(resolve(__dirname, 'dist/foo.bundle.js'))).toBeTruthy(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| // import { dirname, resolve } from 'path'; | ||
| // import { fileURLToPath } from 'url'; | ||
|
|
||
| // const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| const config = { | ||
|
rishabh3112 marked this conversation as resolved.
Outdated
|
||
| mode: 'production', | ||
| entry: './main.js', | ||
| output: { | ||
| path: './dist', | ||
| filename: 'foo.bundle.js', | ||
| }, | ||
| }; | ||
|
|
||
| export default config; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.