Skip to content

Commit 40b3a5f

Browse files
committed
docs: update installation instructions
Point script import users to `unpkg.com` instead of the `dist/` folder in the repo, removing the only reason to track build files in the repo all the time. Also remove *Source import* and *Distribution import* instructions. Those are leftover from the scaffolding template and I don't get the use case.
1 parent b14f2fd commit 40b3a5f

File tree

5 files changed

+6
-58
lines changed

5 files changed

+6
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
2+
dist/
23
npm-debug.log
34
yarn-error.log

README.md

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -250,42 +250,18 @@ Vue.component('my-component', {
250250
251251
**⚠️ A css file is included when importing the package. You may have to setup your bundler to embed the css in your page.**
252252
253-
## Distribution import
254-
255-
Register component globally:
256-
257-
```javascript
258-
import 'vue-qrcode-reader/dist/vue-qrcode-reader.css'
259-
import VueQrcodeReader from 'vue-qrcode-reader/dist/vue-qrcode-reader.common'
260-
261-
Vue.use(VueQrcodeReader)
262-
```
263-
264-
Register locally in other components scope:
265-
266-
```javascript
267-
import 'vue-qrcode-reader/dist/vue-qrcode-reader.css'
268-
import { QrcodeReader } from 'vue-qrcode-reader/dist/vue-qrcode-reader.common'
269-
270-
Vue.component('my-component', {
271-
components: { QrcodeReader },
272-
273-
// ...
274-
)
275-
```
276-
277-
**⚠️ You may have to setup your bundler to embed the css file in your page.**
278-
279253
## Browser
280254
255+
You need to include a script and CSS file. You can pull both from [unpkg.com](https://unpkg.com). Make sure to replace `[VERSION]` with the version you need (for example `1.0.1`):
256+
281257
```html
282-
<link rel="stylesheet" href="vue-qrcode-reader/dist/vue-qrcode-reader.css"/>
258+
<link rel="stylesheet" href="https://unpkg.com/vue-qrcode-reader@[VERSION]/dist/vue-qrcode-reader.css"/>
283259

284260
<script src="vue.js"></script>
285-
<script src="vue-qrcode-reader/dist/vue-qrcode-reader.browser.js"></script>
261+
<script src="https://unpkg.com/vue-qrcode-reader@[VERSION]/dist/vue-qrcode-reader.browser.js"></script>
286262
```
287263
288-
The plugin should be auto-installed. If not, you can install it manually with the instructions below.
264+
The plugin should be auto-installed. If not, you can install it manually.
289265
290266
Register component globally:
291267
@@ -305,32 +281,6 @@ Vue.component('my-component', {
305281
)
306282
```
307283
308-
## Source import
309-
310-
Register component globally:
311-
312-
```javascript
313-
import Vue from 'vue'
314-
import VueQrcodeReader from 'vue-qrcode-reader/src'
315-
316-
Vue.use(VueQrcodeReader)
317-
```
318-
319-
Register locally in other components scope:
320-
321-
```javascript
322-
import Vue from 'vue'
323-
import { QrcodeReader } from 'vue-qrcode-reader/src'
324-
325-
Vue.component('my-component', {
326-
components: { QrcodeReader },
327-
328-
// ...
329-
)
330-
```
331-
332-
**⚠️ You need to configure your bundler to compile `.vue` files.** More info [in the official documentation](https://vuejs.org/v2/guide/single-file-components.html).
333-
334284
---
335285
336286
# License

dist/vue-qrcode-reader.browser.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/vue-qrcode-reader.common.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/vue-qrcode-reader.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)