3.1.0 • Published 6 months ago

jetpack-serve v3.1.0

Weekly downloads
7
License
ISC
Repository
github
Last release
6 months ago

jetpack-serve

This is an express middleware for serving up bundles created by jetpack.

Use this in your app if you don't want to install/require the entire jetpack bundler in your production app.

Usage

Once the app is bundled:

$ jetpack build

You can serve it in your express application:

const express = require('express')
const jetpack = require('jetpack-serve')

const app = express()

app.get('/api/data', (req, res) => {
  res.send('hello')
})

app.use(jetpack())

app.listen(3000, function() {
  console.log('Running server on http://localhost:3000')
})

Options

Jetpack takes the following options:

  • dist - default: "dist"
  • env - default: the value of process.env.NODE_ENV, set to "production" to serve built bundle from dist

This package handles jetpack's differential builds! That is a modern or legacy bundle will be served based on the user agent of the browser.

3.1.0

6 months ago

3.0.0

1 year ago

2.0.0

2 years ago

1.1.0

3 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago