Skip to content
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

feat(build): Added umd version #8

Merged
merged 1 commit into from
Oct 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# vue-six-four

> vue 2.x.x component which generate base64 from a file [Demo](https://codesandbox.io/s/94nzlkwn1o)
> [Demo Umd](https://codepen.io/eperedo/pen/WZaZxa)

![Demo vue-64](https://user-images.githubusercontent.com/461124/31588306-7eb461fc-b1b5-11e7-96ab-27fe12905330.png)

Expand All @@ -16,11 +17,19 @@ npm install vue-six-four --save
import VueSixFour from 'vue-six-four';
```

or include the umd version in a script tag

```html
<script src="https://unpkg.com/vue-six-four/dist/vue-six-four.umd.min.js"></script>
```

```js
// Include as a component
{
components: {
VueSixFour,
VueSixFour,
// if you are using the umd version
// VueSixFour: window.VueSixFour.default,
},
methods: {
getFileInfo(file) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "vue-six-four",
"version": "1.1.0",
"version": "1.1.1",
"description": "vue component which generate base64 from a file",
"author": "Eduardo P. Rivero",
"main": "dist/vue-six-four.min.js",
"files": [
"dist"
],
"scripts": {
"component": "poi build src/components/VueSixFour.vue",
"component": "npm run component-cjs && npm run component-umd",
"component-cjs": "poi build src/components/VueSixFour.vue",
"component-umd": "poi build --config poi-umd.js src/components/VueSixFour.vue",
"dev": "node build/dev-server.js",
"start": "node build/dev-server.js",
"build": "node build/build.js",
Expand Down
11 changes: 11 additions & 0 deletions poi-umd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
entry: './src/VueSixFour.vue',
copy: false,
filename: {
js: 'vue-six-four.umd.min.js'
},
sourceMap: false,
html: false,
format: 'umd',
moduleName: 'VueSixFour',
};