Skip to content

Commit

Permalink
remove defunct build configs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmartel committed Sep 14, 2022
1 parent 5af7280 commit 51c6bd2
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 114 deletions.
173 changes: 73 additions & 100 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,113 +1,86 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'

// https://vitejs.dev/config/
export default defineConfig({
...(process.env.NODE_ENV === 'production'
? {
build: {
lib: {
entry: resolve(__dirname, 'src/ripple/index.ts'),
name: 'Ripple',
fileName: (format) => `ripple.${format}.js`,
base: './',
plugins: [
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg', 'favicon.ico', 'robots.txt', 'safari-pinned-tab.svg', 'apple-touch-icon.png'],
manifest: {
name: 'My Haunted App',
short_name: 'App',
description: 'Description of the application.',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
rollupOptions: {
external: ['haunted'],
output: {
globals: {
haunted: 'Haunted',
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
theme_color: '#000000',
background_color: '#000000',
display: 'standalone',
},

workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/unpkg\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'unpkg-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
},
}
: {
base: './',
plugins: [
VitePWA({
registerType: 'autoUpdate',
includeAssets: [
'favicon.svg',
'favicon.ico',
'robots.txt',
'safari-pinned-tab.svg',
'apple-touch-icon.png',
],
manifest: {
name: 'My Haunted App',
short_name: 'App',
description: 'Description of the application.',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
theme_color: '#000000',
background_color: '#000000',
display: 'standalone',
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},

workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/unpkg\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'unpkg-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'gstatic-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
{
urlPattern: /^https:\/\/fonts\.gstatic\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'gstatic-fonts-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
}),
},
],
}),
},
}),
],
})
14 changes: 0 additions & 14 deletions vite.config.worker.ts

This file was deleted.

0 comments on commit 51c6bd2

Please sign in to comment.