cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.07k stars 397 forks source link

[jss-global] Don't publish `.babelrc` to npm #673

Closed Vanuan closed 5 years ago

Vanuan commented 6 years ago

There's this new bundler, called Parcel. Its behavior relies on .babelrc file published to npm package. If it finds one, it tries to run babel on entrypoint provided in main with the configuration provided in .babelrc. Babel plugins are included in devDependencies section of package.json which are not being installed, so it fails.

Please, publish only files that are necessary for inclusion.

kof commented 6 years ago

Yep, I need to change that for all repos, using files field in package json instead of .npmignore

iamstarkov commented 6 years ago

@Vanuan why does parcel behaves this way?

Vanuan commented 6 years ago

@iamstarkov You should ask its author :) There's an ongoing discussion here: https://github.com/parcel-bundler/parcel/issues/13

It looks like Parcel author tries to establish a practice of publishing source code to npm along with instructions to build it. .babelrc heuristics is just the simplest implementation.

kof commented 6 years ago

This is ultimately wrong from parcel, it uses babelrc config from a project it doesn't own but doesn't install the required dependencies of that project. In any case I probably should not publish the babelrc, so I don't care why they do what they do.

iamstarkov commented 6 years ago

in other words, what did parcel expect?

AleshaOleg commented 5 years ago

https://github.com/cssinjs/jss/pull/961

TrySound commented 5 years ago

This is fixed via package.json files field