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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/webpack-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
"web"
],
"dependencies": {
"@webpack-cli/package-utils": "^1.0.1-alpha.4",
"@webpack-cli/info": "^1.0.1-alpha.4",
"@webpack-cli/init": "^1.0.1-alpha.5",
"@webpack-cli/serve": "^1.0.1-alpha.5",
"@webpack-cli/package-utils": "^1.0.1-alpha.4",
"ansi-escapes": "^4.3.1",
"colorette": "^1.2.1",
"command-line-usage": "^6.1.0",
"commander": "^6.0.0",
"enquirer": "^2.3.4",
"execa": "^4.0.0",
"import-local": "^3.0.2",
"interpret": "^2.0.0",
"interpret": "^2.2.0",
"rechoir": "^0.7.0",
"v8-compile-cache": "^2.1.0",
"webpack-merge": "^4.2.2"
Expand Down
1 change: 1 addition & 0 deletions test/config-format/mjs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('Hoshiumi');
13 changes: 13 additions & 0 deletions test/config-format/mjs/mjs-config.test.js
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();
});
});
15 changes: 15 additions & 0 deletions test/config-format/mjs/webpack.config.mjs
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 = {
mode: 'production',
entry: './main.js',
output: {
path: './dist',
filename: 'foo.bundle.js',
},
};

export default config;
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6849,7 +6849,7 @@ interpret@^1.0.0:
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==

interpret@^2.0.0:
interpret@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9"
integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
Expand Down