question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V2: How to control `dist` directory

See original GitHub issue

Parcel Version: 2.0.0-alpha.3.1 OS: Ubuntu 18.04


Context:

I have a pretty simple use case that worked well with parcel 1.x

Basically, I have a server that serves out of public directory where I’d like my build to be placed.

Example: /server/public/js

In Parcel’s previous version, I just used the -d option to do something like: parcel watch ./app/client/src/index.tsx -d ./dist/server/public/js

or

parcel build ./app/client/src/index.tsx -d ./dist/server/public/js

In the current version, I receive an error: error: unknown option -d

I’ve tried finding this option via the README, parcel --help build, and searching “dist” on the repo. If this is documented somewhere, it’s not clear and/or buried.


Questions

  • Is there a migrating guide?

  • Can I control where output is placed?

Coming from other configuration tools, this has been a godsend. So, thanks for the ease of use.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

19reactions
vladinator1000commented, Dec 12, 2019

If you have scripts like

  "scripts": {
    "build:client": "parcel build client/index.html --out-dir dist/client",
    "build:server": "parcel build server/index.js --target node --out-dir dist/server",
}

How would you migrate that to v2?

17reactions
mischniccommented, May 7, 2021

@eduardobcastro You probably have a main: "index.html" line in your package.json. Remove that

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the meaning of the /dist directory in open source ...
To answer your question: /dist means "distributable", the compiled code/library. Folder structure varies by build system and programming language.
Read more >
Dist directory - Nuxt
The dist folder, short for distribution folder, is dynamically generated when using the nuxt generate commands and includes the generated production ready ...
Read more >
4.1. Quickstart — Cabal 3.8.1.0 User's Guide
Then, to build every component of every package, from the top-level directory, run the command: (using cabal-install-2.0 or greater.) $ cabal v2-build all....
Read more >
CopyFiles@2 - Copy files v2 task - Microsoft Learn
Copy files v2 # Copy files from a source folder to a target folder using patterns matching file paths (not folder paths).
Read more >
Output Management - webpack
Now run an npm run build and inspect the /dist folder. If everything went well you should now only see the files generated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found