Update CLI to pass options to presets & plugins
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- cli
調査の方向性
Start at the CLI's transform-option normalization, focusing on the proposed normalizeTransformOpts and normalizePluginPresets behavior. Decide which preset-option syntax to support, then verify that options such as modules: commonjs reach @babel/preset-env and that the shown CLI invocation works.
索引モデルが issue の本文から書いたものです。
説明
With Babel 8, the default value of modules in @bablel/preset-env is no longer commonjs but ESM. This is not supported in base Browserify, as far as I know, necessitating passing an explicit modules option to present-env. This is not yet possible as far as I can tell in the CLI but in my fork I added:
function normalizeTransformOpts(opts) {
// ...
if (Array.isArray(opts.plugins)) opts.plugins = normalizePluginPresets(opts.plugins)
if (Array.isArray(opts.presets)) opts.presets = normalizePluginPresets(opts.presets)
// ...
}
function normalizePluginPresets(opts) {
opts = opts.slice()
for (let i = 0; i < opts.length; i++) {
if (opts[i]._) {
opts[i] = [
opts[i]._[0],
Object.assign({}, opts[i])
]
delete opts[i][1]._
}
}
return opts
}
The following CLI does then work:
-t [ babelify --presets [ [ @babel/preset-env --modules commonjs ] @babel/preset-react ]
I can start a PR if that is the preferred syntax. Alternatively:
-t [ babelify --presets [ [ @babel/preset-env [ --modules commonjs ] ] @babel/preset-react ]
- 主要言語
- JavaScript
- スター
- 1.7k
- フォーク
- 112
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
babel/babelify のほかの issue
-
Babel 8オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
Continued problems with issue #103 ('import' and 'export' may appear only with 'sourceType: module')オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
似ている issue
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceオープンbug 🐛
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
comunica/comunica#1960 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
getsentry/sentry-javascript#26203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bytedance/flowgram.ai#1235 ·
メンテナーはふだん 1 日以内に返信