Add full *.map file support

This commit is contained in:
Nolan Lawson
2018-03-18 16:16:52 -07:00
parent cf90476255
commit fc2312eba6
3 changed files with 10 additions and 1 deletions

View File

@@ -25,6 +25,10 @@ export async function exporter(export_dir: string, { basepath = '' }) {
sander.copyFileSync(build_dir, 'service-worker.js').to(export_dir, 'service-worker.js');
}
if (sander.existsSync(build_dir, 'service-worker.js.map')) {
sander.copyFileSync(build_dir, 'service-worker.js.map').to(export_dir, 'service-worker.js.map');
}
const port = await ports.find(3000);
const origin = `http://localhost:${port}`;

View File

@@ -77,6 +77,11 @@ export default function middleware({ routes, store }: {
cache_control: 'max-age=600'
}),
fs.existsSync(path.join(output, 'service-worker.js.map')) && serve({
pathname: '/service-worker.js.map',
cache_control: 'max-age=600'
}),
serve({
prefix: '/client/',
cache_control: 'max-age=31536000'

View File

@@ -29,7 +29,7 @@ application/java-archive jar
application/java-serialized-object ser
application/java-vm class
application/javascript js
application/json json
application/json json map
application/jsonml+json jsonml
application/lost+xml lostxml
application/mac-binhex40 hqx