marcuswestin / store.js

Cross-browser storage for all use cases, used across the web.
MIT License
14.02k stars 1.33k forks source link

Userland Make error caused by ~/.babelrc #205

Open StevenBlack opened 7 years ago

StevenBlack commented 7 years ago

Problem: Userland ~/.babelrc can cause havoc with make.

Mangling the ~/.babelrc file name solves the issue, but I'm thinking the store.js Make should override my (very simple) ~/.babelrc

Reproduce

When I run

$ node scripts/compile-builds.js

I get the following Make error:

compile ~/dev/Javascript/store.js/dist/store.everything.js -> ~/dev/Javascript/store.js/dist/store.everything.min.js
~/dev/Javascript/store.js/scripts/compile-builds.js:19
        if (err) { throw err }
                   ^

ReferenceError: Unknown plugin "add-module-exports" specified in "~/.babelrc" at 0, attempted to resolve relative to "~" while parsing file: ~/dev/Javascript/store.js/dist/store.everything.js
    at ~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/file/index.js:139:24)
    at Pipeline.transform (~/dev/Javascript/store.js/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at Babelify._flush (~/dev/Javascript/store.js/node_modules/babelify/index.js:27:24)
    at Babelify.<anonymous> (_stream_transform.js:118:12)

To rectify this, I temporarily renamed my ~/.babelrc file and all built fine.

Here's my ~/.babelrc file before I mangled its name so this repo could Make:

{
  "plugins": [ "add-module-exports" ],
  "presets": [ "es2015" ]
}
PDS42 commented 7 years ago

@StevenBlack Did you manage to solve this issue? If yes, do you mind helping me out? Been having the same issue for a couple of hours now