-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STRWEB-99 bundle stripes-core's service-worker.js (#125)
Include `service-worker.js`, pulled from `@folio/stripes-core/src/service-worker.js`, in the output bundle so it can be registered via `navigator.serviceWorker.register(...)`. Handle the service-worker in a completely separate bundle (multi-compile). Refs STRWEB-99, FOLIO-3627 --------- Co-authored-by: Michał Kuklis <[email protected]> (cherry picked from commit 432e1c3)
- Loading branch information
Showing
5 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const path = require('path'); | ||
|
||
const config = { | ||
name: 'service-worker', | ||
mode: 'development', | ||
target: 'web', | ||
entry: { | ||
'service-worker': { | ||
import: '@folio/stripes-core/src/service-worker.js', | ||
filename: 'service-worker.js', | ||
} | ||
}, | ||
output: { | ||
path: path.join(__dirname, 'dist'), | ||
filename: 'service-worker.js', | ||
publicPath: '/', | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'esbuild-loader', | ||
options: { | ||
target: 'es2015' | ||
} | ||
}, | ||
] | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters