mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-12 02:15:17 +00:00
add service worker config
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
"scripts": {
|
||||
"dev": "sapper dev",
|
||||
"build": "sapper build",
|
||||
"start": "cross-env NODE_ENV=production node server.js",
|
||||
"export": "sapper export",
|
||||
"start": "cross-env NODE_ENV=production node .sapper/server.js",
|
||||
"cy:run": "cypress run",
|
||||
"cy:open": "cypress open",
|
||||
"test": "run-p --race dev cy:run"
|
||||
|
||||
17
webpack/service-worker.config.js
Normal file
17
webpack/service-worker.config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const path = require('path');
|
||||
const config = require('sapper/webpack/config.js');
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
'service-worker': './app/service-worker.js'
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(`.sapper`),
|
||||
filename: '[name].js',
|
||||
chunkFilename: '[name].[id].[hash].js'
|
||||
},
|
||||
plugins: [
|
||||
!config.dev && new webpack.optimize.ModuleConcatenationPlugin()
|
||||
].filter(Boolean)
|
||||
};
|
||||
Reference in New Issue
Block a user