Skip to content

Commit 3262070

Browse files
committed
chore: use Vue CLI provided config boilerplate
Issue: #51
1 parent 0091007 commit 3262070

30 files changed

+20469
-278
lines changed

.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.browserslistrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
ie >= 10

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
module.exports = {
22
root: true,
3-
parser: "babel-eslint",
3+
env: {
4+
node: true
5+
},
6+
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
47
parserOptions: {
5-
sourceType: "module"
8+
parser: "babel-eslint"
69
},
7-
extends: "prettier",
8-
// required to lint *.vue files
9-
plugins: ["html"],
10-
env: {
11-
browser: true
12-
}
13-
// add your custom rules here
14-
// 'rules': {
15-
// // allow paren-less arrow functions
16-
// 'arrow-parens': 0,
17-
// // allow async-await
18-
// 'generator-star-spacing': 0,
19-
// // allow debugger during development
20-
// 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
21-
// // trailing comma
22-
// 'comma-dangle': ['error', 'always-multiline'],
23-
// }
10+
rules: {
11+
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13+
},
14+
overrides: [
15+
{
16+
files: [
17+
"**/__tests__/*.{j,t}s?(x)",
18+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
19+
],
20+
env: {
21+
mocha: true
22+
}
23+
}
24+
]
2425
};

.gitignore

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
node_modules/
2-
dist/
3-
npm-debug.log
4-
yarn-error.log
5-
package-lock.json
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
/tests/e2e/videos/
6+
/tests/e2e/screenshots/
7+
8+
# local env files
9+
.env.local
10+
.env.*.local
11+
12+
# Log files
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
18+
# Editor directories and files
19+
.idea
20+
.vscode
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?

.npmignore

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ The newest API these components depend on is the [FileReader API](https://canius
118118

119119
# Installation :package:
120120

121-
## Module import
121+
## With NPM
122122

123-
Run:
123+
Run
124124

125125
```bash
126126
npm install vue-qrcode-reader
127127
```
128128

129-
Either import the components independantly for local registration:
129+
You can import the components independantly
130130

131131
```javascript
132132
import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from 'vue-qrcode-reader'
@@ -143,7 +143,7 @@ const MyComponent = {
143143
))
144144
```
145145
146-
Or register all of them globally right away:
146+
or register all of them globally right away
147147
148148
```javascript
149149
import Vue from "vue";
@@ -152,14 +152,35 @@ import VueQrcodeReader from "vue-qrcode-reader";
152152
Vue.use(VueQrcodeReader);
153153
```
154154
155-
**⚠️ A css file is included when importing the package. You may have to setup your bundler to embed the css in your page.**
155+
## Without NPM
156156
157-
## Classic import
157+
<!--
158+
CHANGE NEXT RELEASE:
158159
159-
Vue itself must be included first. Then add the following CSS and JS file:
160+
Include the following JS files:
160161
161-
- `<link href="`[vue-qrcode-reader.css](https://unpkg.com/vue-qrcode-reader/dist/vue-qrcode-reader.css)`" rel="stylesheet">`
162-
- `<script src="`[vue-qrcode-reader.browser.js](https://unpkg.com/vue-qrcode-reader/dist/vue-qrcode-reader.browser.js)`"></script>`
162+
https://unpkg.com/vue-qrcode-reader/dist/VueQrcodeReader.umd.min.js
163+
https://unpkg.com/vue-qrcode-reader/dist/VueQrcodeReader.umd.min.1.js
164+
165+
Make sure to include them after Vue:
166+
167+
```html
168+
<script src="./vue.js"></script>
169+
<script src="./VueQrcodeReader.umd.min.js"></script>
170+
<script src="./VueQrcodeReader.umd.min.1.js"></script>
171+
```
172+
-->
173+
174+
Include the following JS file:
175+
176+
https://unpkg.com/vue-qrcode-reader/dist/vue-qrcode-reader.browser.js
177+
178+
Make sure to include it after Vue:
179+
180+
```html
181+
<script src="./vue.js"></script>
182+
<script src="./vue-qrcode-reader.browser.js"></script>
183+
```
163184
164185
All components are automatically registered globally.
165186
Use kebab-case to reference them in your templates:

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@vue/cli-plugin-babel/preset"]
3+
};

config/webpack.config.base.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

config/webpack.config.browser.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)