Parcel dev server but with support for proxies

Downloads in past


1.1.05 years ago5 years agoMinified + gzip package size for parcel-proxy-server in KB


A small wrapper around the parcel development server that adds support for proxies, just like webpack.


yarn add parcel parcel-proxy-server

npm install parcel parcel-proxy-server


This project exposes an api for starting up a proxy server.


const ParcelProxyServer = require('parcel-proxy-server');

// configure the proxy server
const server = new ParcelProxyServer({
  entryPoint: './path/to/my/entry/point',
  parcelOptions: {
    // provide parcel options here
    // these are directly passed into the
    // parcel bundler
    // More info on supported options are documented at
    https: true
  proxies: {
    // add proxies here
    '/api': {
      target: ''

// the underlying parcel bundler is exposed on the server
// and can be used if needed
server.bundler.on('buildEnd', () => {
  console.log('Build completed!');

// start up the server
server.listen(8080, () => {
  console.log('Parcel proxy server has started');

How it works

This wrapper doesn't do too much under the hood. A parcel bundler is created using the configuration that is passed in. An express server is started and http-proxy-middleware is used to apply proxies. The bundler middleware then applied to the express server to serve files.
To preserve some of the behaviour that the vanilla parcel serve command supports, the project.
For example, if the https option is set to true, the server will generate certs and provide that to the server that gets created so that things like HMR can still function.