fe-dev-server-plugin-static v0.0.21
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
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago