Skip to content

Commit

Permalink
Merge pull request #8 from eperedo/issue-7
Browse files Browse the repository at this point in the history
feat(build): Added umd version
  • Loading branch information
eperedo authored Oct 22, 2017
2 parents 7c15e6f + d9c935b commit 23b0e75
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
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',
};

0 comments on commit 23b0e75

Please sign in to comment.