browserify / browserify/browserify

Settings (transforms, plugins etc) disappear in sub-directories with package.json

Open
#1,623 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.7k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

First off, the behaviour itself is probably correct, but it bit us anyway.

The situation: One largish project, containing several subfolders, using babelify to do es6 transpiling. Suddenly started to choke on later minification, turns out some es6 files weren't being transpiled. Took a while to find which files and then why: there was a package.json in that folder, which only was used to rename the main script from index.js (so they aren't all named that).

Since the package.json did not list transforms, the parent ones weren't applied.

This seems correct, but the problem was that it was silent, surprising and not that straightforward to get to the bottom of.

Possible solutions:
- Warnings - make noise in the log when this happens, easy to see, easy to fix
- Inherit settings - unless new transforms etc are specified, use them in subfolder too - probably usually what is expected
- Fail unless new settings (even empty) are explicitly specified

I'd be fine with a clear warning, but inheritance is probably what many would expect when there's no new browserify field at all.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.