Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's time to talk about 'parcel.config.js' #365

Closed
hyingreborn opened this issue Dec 21, 2017 · 20 comments

Comments

Projects
None yet
@hyingreborn
Copy link

commented Dec 21, 2017

webpack 100 lines
parcel 0 lines
I need 10 lines

Zero configuration is an impossible desire,people like simple ,but project need configurability

@shawwn shawwn added the 💬 RFC label Dec 21, 2017

@shawwn

This comment has been minimized.

Copy link
Member

commented Dec 21, 2017

It would be helpful to list a few scenarios that this config file should support. Maybe we can either make it unnecessary or at least do the absolute minimum configuration.

Note that we need to put a lot of thought into this. It's important not to just ship a half-baked solution for one or two cases. Whatever we do here will affect all parcel users, and a lot of people are starting to use parcel now.

@TheLarkInn

This comment has been minimized.

Copy link

commented Dec 21, 2017

I thought that kind of goes against the value proposition. Or is this more to approach this in a really sensible way. (BTW we are challenged in the same way with this at webpack). It all boils down to the maintainibility and "surprise" level of the API.

@yeskunall

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2017

From the tagline:

Blazing fast, zero configuration web application bundler

... and I quite like that it's zero configuration. That's what caught my eye in the first place.

But like @shawwn said, this needs to be discussed in great lengths before we make a decision.

@rondonjon

This comment has been minimized.

Copy link

commented Dec 21, 2017

Stay strong, resist the temptation.

As I understand it, parcel was meant to be different. If that works out, it is a true benefit.

There are plenty of alternativew available for edge cases.

@DeMoorJasper

This comment has been minimized.

Copy link
Member

commented Dec 21, 2017

In think the only config we would need is a .parcelignore, this way we could specify packages to ignore completely or not parse. Everything else can already be configured in their own config file.

Which could contain the following:

node_modules/jQuery // Ignore this entirely
node_modules/React // Ignore this entirely
!node_modules/lodash // Parser can skip this and just bundle it as is
@devongovett

This comment has been minimized.

Copy link
Member

commented Dec 22, 2017

I would like to avoid adding a parcel specific config. Once we add it, it's a slippery slope to end up like webpack. If there are specific configurations you need, please open issues for those and we will discuss them case by case, but usually configurations can be limited to ones that are specific to related tools like .babelrc, .postcssrc, etc.

@eavichay

This comment has been minimized.

Copy link

commented Mar 20, 2018

in the context of custom elements, babel requires a custom plugin transform-class-properties in order to work properly. But this breaks the source maps config. Can the source maps method be changed in parcel somehow? Switch from inline-source-maps to eval and vice versa?

@davidnagli

This comment has been minimized.

Copy link
Member

commented Mar 20, 2018

@eavichay No, there's no way to configure source maps currently. Please open a new issue if the way source-maps work is causing any problems.

@Javiani

This comment has been minimized.

Copy link

commented Apr 7, 2018

I really tried to use Parcel, but that no configuration philosophy doesn't quite match reality.
The last plugin I tried to use was nunjucks plugin, but I coudn't configure it at all, like adding globals, filters, and that makes it quite useless if you can't extend it.

Documentation is also pretty poor...

I got several cases where I coudn't make a simple application to work due to its inflexible nature.

I'm really impressed to see that it has more than 22,000 likes.. It's not mature, the most available plugins are quite amateur ... It might be useful for some presentations or simple apps, but it's seems not meant to be used in most production apps...

To have a bundler with no configuration is the same as create an application using only functions with no arguments. It's a really strange way of thinking for me...

Gulp still has the most smart way of doing things...even though it's not a bundler...

@eavichay

This comment has been minimized.

Copy link

commented Apr 9, 2018

@Javiani I Agree partially. Zero configuration is just like using webpack with all the defaults. I think that configuration simplicity is (i.e. optional tweaks) is mandatory in a bundling tool.

If at least it would load .babelrc, .babelconfig, .loaders ... as optionals I would say it could help but in real life you need tweaks to meet developer requirements.

@Squeegy

This comment has been minimized.

Copy link

commented Jul 20, 2018

Parcel is not zero config, really, if you consider the CLI options as configuration.

I currently have these scripts in my package.json to make parcel work with an electron app.

    "parcel:build": "parcel build src/renderer/index.html src/main/index.js --target electron --public-url .. --out-dir dist --cache-dir .parcel-cache",
    "parcel:watch": "parcel watch src/renderer/index.html src/main/index.js --target electron --public-url .. --out-dir dist --cache-dir .parcel-cache"

It sure would be nice if at least the CLI options could be abstracted to a .parcelrc or something.

@tunnckoCore

This comment has been minimized.

Copy link

commented Jul 27, 2018

@Squeegy Exactly, i'm for that too.

@gaui

This comment has been minimized.

Copy link

commented Aug 2, 2018

👍 for .parcelrc

@dandv

This comment has been minimized.

Copy link
Contributor

commented Dec 11, 2018

I want Parcel to not do any transpilation, because I'm only targeting Chrome. If I do that via .babelrc, I get an error that Parcel

Failed to install babel-core

Well, that's the point, I don't want babel-core.

@devongovett

This comment has been minimized.

Copy link
Member

commented Dec 11, 2018

@dandv you can use browserslist to disable transpilation. Just add ”browserslist”: [“last 1 Chrome version”] to your package.json. By adding a babelrc file, you are explicitly enabling Babel.

@dandv

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2018

Thanks @devongovett, that worked. I'd like to extract that definition into .browserlistrc, but parcel seems to ignore that file. Same for .browserlist. Is that intended?

@n0v1

This comment has been minimized.

Copy link

commented Mar 11, 2019

@dandv the config file should be named either browserslist or .browserslistrc. You missed the s in browserSlist.

@AntonioRecaldeRusso

This comment has been minimized.

Copy link

commented Mar 19, 2019

All it takes is one cigarette.. Next thing you know, you're smoking 2 boxes per day

@mikestopcontinues

This comment has been minimized.

Copy link

commented Apr 25, 2019

Lest we forget shoving our config in package.json!

@GeorgeTaveras1231

This comment has been minimized.

Copy link

commented May 19, 2019

Would be nice to get parcel to work in monorepo environments. I like to use the babel option rootMode: upwards to maintain one central babel config at the root of my repository. On top of that, parcel doesn't support the babel extends option which would allow me to compose my babel configs. My current work around is to duplicate my babel configs for each project using parcel within the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.