hubert17 / gabsvuetifynoclinodewebpack Goto Github PK
View Code? Open in Web Editor NEWVue and Vuetify without CLI, Node and Webpack
Vue and Vuetify without CLI, Node and Webpack
Remove or comment out this:
// src/router.js
...
...
/*
comment out these callback if you want to use `prompt`
router.onReady(async() => {
const { registerSW } = await import("virtual:pwa-register")
registerSW({ immediate: true })
})
*/
...
...
This will work on any server, also on development:
// src/router.js
const router = new VueRouter({
base: '/GabsVuetifyNoCLINodeWebpack/',
mode: 'history', // real path
routes, // short for `routes: routes`
});
// vite.config.js
...
base: '/GabsVuetifyNoCLINodeWebpack/',
plugins: [
createVuePlugin(),
VitePWA({
// for prompt comment the option or just remove this option, since it is the default behavior */
base: '/GabsVuetifyNoCLINodeWebpack/',
registerType: 'prompt',
includeAssets: ['favicon.svg'],
manifest: {
name: 'PWA Vue2',
short_name: 'PWA Vue2',
description: 'Vite PWA + Vue2 + Vite',
theme_color: '#ffffff',
start_url: '/GabsVuetifyNoCLINodeWebpack/',
icons: [
...
Add this entry below manifest
entry on vite.config.js
.
workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/cdn\.vuetifyjs\.com\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'vuetifyjs-cache',
expiration: {
maxEntries: 10,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: /^https:\/\/cdn\.jsdelivr\.net\/.*/i,
handler: 'CacheFirst',
options: {
cacheName: 'jsdelivr-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],
},
},
},
],
You also need to add to index.html
crossorigin="anonymous"
to exteranl links and scripts:
<link crossorigin="anonymous" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" />
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet" />
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet" />
<title>Hello Vue World!</title>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuex.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js"></script>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.