babel / babel/generator-babel-plugin

Need commonjs export patch for build

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
122
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Babel 6.x do not transform `export default` to `module.exports`, and most babel presets are written in commonjs which do not compatible with `exports.default`.

Solution:
Change `"build": "babel src -d lib"` to `"build": "babel src -d lib && echo \"\nmodule.exports = exports['default'];\" >> lib/index.js"`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in package.json and inspect the build script that runs Babel from src to lib. Run the build and check lib/index.js; done means the generated entry point exposes the default export through CommonJS as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript
Domain
build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.