Last active
July 14, 2017 17:21
-
-
Save RemeJuan/14f7012a593c0ae3550ed7df5009315c to your computer and use it in GitHub Desktop.
PWA: Webpack
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
const SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin'); | |
const WebpackPwaManifest = require('webpack-pwa-manifest'); | |
const PUBLIC_PATH = 'https://www.remelehane.me/'; | |
module: { | |
// Snip | |
plugins: [ | |
// Snip | |
new SWPrecacheWebpackPlugin( | |
{ | |
cacheId: 'remelehane', | |
dontCacheBustUrlsMatching: /\.\w{8}\./, | |
filename: 'service-worker.js', | |
minify: true, | |
navigateFallback: PUBLIC_PATH + 'index.html', | |
staticFileGlobsIgnorePatterns: [/\.map$/, /manifest\.json$/] | |
} | |
), | |
new WebpackPwaManifest({ | |
name: 'Reme Le Hane: Portfolio', | |
short_name: 'RLH', | |
description: 'My Personal Portfolio!', | |
background_color: '#01579b', | |
theme_color: '#01579b', | |
'theme-color': '#01579b', | |
start_url: '/', | |
icons: [ | |
{ | |
src: path.resolve('src/assets/images/RTMS-Icon.png'), | |
sizes: [96, 128, 192, 256, 384, 512], | |
destination: path.join('assets', 'icons') | |
} | |
] | |
}) | |
], | |
output: { | |
path: path.join(process.cwd(), conf.paths.dist), | |
filename: '[name]-[hash].js', | |
publicPath: PUBLIC_PATH | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment