babel / babel/babel-loader

Pass Babel AST directly

Open
#539 17 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
456
Avg merge
9h 19m
Merged PRs (30d)
2

Description

**I'm submitting a feature request**

**Webpack Version:**

`v4.0.0 (@next)`

**Babel Core Version**:

`v7.0.0 (@next)`

**Babel Loader Version**:

`v8.0.0`

**Current behavior:**

Pass `result.code` `{String}`

**Desired behavior:**

Pass `result.ast` as metadata `cb(null, code, map, { webpackAST: ast /* result.ast */ })` `{Object}`

> ⚠️ Needs to be compatible to the Acorn AST (ESTree) ([webpack #5925](https://github.com/webpack/webpack/pull/5925))

* **What is the motivation / use case for changing the behavior?**

Avoid unnecessary parsing, if possible

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named in the issue. Start by reviewing how the loader currently passes Babel's result to webpack, then check the Acorn AST compatibility requirement in webpack #5925. Done means exposing result.ast as webpackAST metadata without the unnecessary parsing described in the request.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.