File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,11 @@ const path = require("path");
55const sirv = require ( "sirv" ) ;
66
77const workerPath = require . resolve ( "css-to-js-sourcemap-worker" ) ;
8+ const wasmPath = path . join ( path . dirname ( workerPath ) , "mappings.wasm" ) ;
89
910const assets = sirv ( path . join ( __dirname , "static" ) ) ;
1011const worker = sirv ( path . dirname ( workerPath ) ) ;
12+ const wasm = sirv ( path . dirname ( wasmPath ) ) ;
1113
1214const routes = {
1315 "/no-map" : "/no-map.js" ,
@@ -26,6 +28,9 @@ function createServer() {
2628 res . statusCode = 200 ;
2729 return void res . end ( template ( script ) ) ;
2830 }
31+ if ( req . url === "/mappings.wasm" ) {
32+ return wasm ( req , res ) ;
33+ }
2934 if ( req . url === "/worker.js" ) {
3035 return worker ( req , res ) ;
3136 }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ test(`single mapped class works on /no-map`, async t => {
5353 page . evaluate ( ( ) => {
5454 window . worker . postMessage ( {
5555 id : "init_wasm" ,
56- url : "https://unpkg.com/source-map@0.7.3/lib /mappings.wasm" ,
56+ url : "/mappings.wasm" ,
5757 } ) ;
5858 window . worker . postMessage ( {
5959 id : "add_mapped_class" ,
@@ -97,7 +97,7 @@ test(`replaying requests after invalidation`, async t => {
9797 page . evaluate ( ( ) => {
9898 window . worker . postMessage ( {
9999 id : "init_wasm" ,
100- url : "https://unpkg.com/source-map@0.7.3/lib /mappings.wasm" ,
100+ url : "/mappings.wasm" ,
101101 } ) ;
102102 window . worker . postMessage ( {
103103 id : "add_mapped_class" ,
@@ -147,7 +147,7 @@ function testSingleMap(route) {
147147 page . evaluate ( ( ) => {
148148 window . worker . postMessage ( {
149149 id : "init_wasm" ,
150- url : "https://unpkg.com/source-map@0.7.3/lib /mappings.wasm" ,
150+ url : "/mappings.wasm" ,
151151 } ) ;
152152 window . worker . postMessage ( {
153153 id : "add_mapped_class" ,
You can’t perform that action at this time.
0 commit comments