-
Notifications
You must be signed in to change notification settings - Fork 387
Replace unpkg with jsdelivr for reliability #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hykilpikonna
wants to merge
2
commits into
vuejs:main
Choose a base branch
from
AzaContrib:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
`petite-vue` can be used without a build step. Simply load it from a CDN: | ||
|
||
```html | ||
<script src="https://unpkg.com/petite-vue" defer init></script> | ||
<script src="https://cdn.jsdelivr.net/npm/petite-vue" defer init></script> | ||
|
||
<!-- anywhere on the page --> | ||
<div v-scope="{ count: 0 }"> | ||
|
@@ -38,7 +38,7 @@ | |
If you don't want the auto init, remove the `init` attribute and move the scripts to end of `<body>`: | ||
|
||
```html | ||
<script src="https://unpkg.com/petite-vue"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/petite-vue"></script> | ||
<script> | ||
PetiteVue.createApp().mount() | ||
</script> | ||
|
@@ -48,7 +48,7 @@ Or, use the ES module build: | |
|
||
```html | ||
<script type="module"> | ||
import { createApp } from 'https://unpkg.com/petite-vue?module' | ||
import { createApp } from 'https://cdn.jsdelivr.net/npm/petite-vue?module' | ||
createApp().mount() | ||
</script> | ||
``` | ||
|
@@ -57,9 +57,9 @@ Or, use the ES module build: | |
|
||
The short CDN URL is meant for prototyping. For production usage, use a fully resolved CDN URL to avoid resolving and redirect cost: | ||
|
||
- Global build: `https://unpkg.com/[email protected]/dist/petite-vue.iife.js` | ||
- Global build: `https://cdn.jsdelivr.net/npm/[email protected]/dist/petite-vue.iife.js` | ||
- exposes `PetiteVue` global, supports auto init | ||
- ESM build: `https://unpkg.com/[email protected]/dist/petite-vue.es.js` | ||
- ESM build: `https://cdn.jsdelivr.net/npm/[email protected]/dist/petite-vue.es.js` | ||
- Must be used with `<script type="module">` | ||
|
||
### Root Scope | ||
|
@@ -68,7 +68,7 @@ The `createApp` function accepts a data object that serves as the root scope for | |
|
||
```html | ||
<script type="module"> | ||
import { createApp } from 'https://unpkg.com/petite-vue?module' | ||
import { createApp } from 'https://esm.run/petite-vue' | ||
|
||
createApp({ | ||
// exposed to all expressions | ||
|
@@ -153,7 +153,7 @@ First, reusable scope logic can be created with functions: | |
|
||
```html | ||
<script type="module"> | ||
import { createApp } from 'https://unpkg.com/petite-vue?module' | ||
import { createApp } from 'https://esm.run/petite-vue' | ||
|
||
function Counter(props) { | ||
return { | ||
|
@@ -189,7 +189,7 @@ If you also want to reuse a piece of template, you can provide a special `$templ | |
|
||
```html | ||
<script type="module"> | ||
import { createApp } from 'https://unpkg.com/petite-vue?module' | ||
import { createApp } from 'https://esm.run/petite-vue' | ||
|
||
function Counter(props) { | ||
return { | ||
|
@@ -224,7 +224,7 @@ You can use the `reactive` method (re-exported from `@vue/reactivity`) to create | |
|
||
```html | ||
<script type="module"> | ||
import { createApp, reactive } from 'https://unpkg.com/petite-vue?module' | ||
import { createApp, reactive } from 'https://esm.run/petite-vue' | ||
|
||
const store = reactive({ | ||
count: 0, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.