0.0.21 • Published 1 year ago

fe-dev-server-plugin-static v0.0.21

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

fe-dev-server-plugin-static

A plugin for static assets service

Config

dir

string - the location of static files

etag

object

etag.enable: boolean or function receiving filepath, Default: false - enable or disable setting E-Tag response header

lastModified

object

lastModified.enable: boolean or function receiving filepath, Default: false - enable or disable setting Last-Modified response header

cacheControl

object

cacheControl.maxAge: number, Default: 0 - max-age in millisecnds for http caching

cacheControl.enable: boolean or function receiving filepath, Default: false - enable or disable setting Cache-Control response header

skipNotFound

boolean, Default: true - the strategy of specify file not found, returning 404 when config as true, and skipping to next plugin when config as false

pathnameFormatter

function - change the pathname for the request in order to use other static file for response

({
  pathnameFormatter: ({ headers, pathname, search }) => {
    // making / alias for /index.html
    if (pathname === '/') {
      return '/index.html';
    }
    return pathname;
  },
});

compression

object

compression.enable: boolean or function receiving filepath, Default: false - enable or disable compression

compression.dir: string - the location of compressed files

compression.types: CompressionType[] - the supported compression type

0.0.20

1 year ago

0.0.21

1 year ago

0.0.19

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.16

1 year ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago