Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
feat(template): undo umd and cjs directories and export of .vue files
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkc committed Dec 27, 2017
1 parent 897e8c9 commit bf811f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 4 additions & 16 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,11 @@

## Usage

### With [vue-loader](https://github.com/vuejs/vue-loader) or [vueify](https://github.com/vuejs/vueify)

```js
import {{ camelcase name }} from '{{ name }}.vue';

Vue.component('{{ name }}', {{ camelcase name }});
```

```html
<{{name}} text="Hello World!"></{{name}}>
```

### ES6 Modules / CommonJS

```js
import {{ camelcase name }} from '{{ name }}/cjs/{{ name }}.min.js';
import '{{ name }}/cjs/{{ name }}.min.css';
import {{ camelcase name }} from '{{ name }}';
import '{{ name }}/dist/{{ name }}.min.css';

Vue.component('{{ name }}', {{ camelcase name }});
```
Expand All @@ -49,8 +37,8 @@ Vue.component('{{ name }}', {{ camelcase name }});
<{{name}} text="Hello World!"></{{name}}>

<script src="https://unpkg.com/vue" charset="utf-8"></script>
<script src="./umd/{{ name }}.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="./umd/{{ name }}.min.css">
<script src="./dist/umd/{{ name }}.min.js" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="./dist/umd/{{ name }}.min.css">

<script type="text/javascript">
Vue.component('{{ name }}', window.{{ camelcase name }});
Expand Down
7 changes: 3 additions & 4 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.0.1",
"description": "{{ description }}",
"author": "{{ author }}",
"main": "src/{{name}}/{{name}}.vue",
"main": "dist/{{name}}.min.js",
"license": "MIT",
"scripts": {
"lint": "eslint src/**/*.vue",
"build": "poi build --format cjs --dist cjs; poi build --format umd --dist umd",
"build": "poi build --format cjs --dist dist; poi build --format umd --dist dist/umd",
"build:doc": "vue-styleguidist build",
"serve": "vue-styleguidist server",
"test": "poi test",
Expand All @@ -20,8 +20,7 @@
],
"files": [
"src/",
"umd/",
"cjs/"
"dist/"
],
"dependencies": {
"vue": "^2.5.3"
Expand Down

0 comments on commit bf811f8

Please sign in to comment.