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

Commit

Permalink
change default build to commonjs
Browse files Browse the repository at this point in the history
add option to build to umd
change build tool
  • Loading branch information
klarkc committed Oct 16, 2017
1 parent 5500306 commit 77e854f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
9 changes: 9 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@

# Usage

```js
import Component from '{{name}}'

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

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

PS: You can also build to UMD with `npm run build:umd`, the component will be
available in the window['{{name}}'] variable.

## Installation

### Using yarn
Expand Down
13 changes: 0 additions & 13 deletions template/build.config.js

This file was deleted.

8 changes: 5 additions & 3 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"version": "0.0.1",
"description": "{{ description }}",
"author": "{{ author }}",
"main": "dist/index.js",
"main": "dist/{{name}}.min.js",
"license": "MIT",
"scripts": {
"lint": "eslint src",
"build": "vue build ./src/index.js --config ./build.config.js --dist ./dist/ --prod --lib",
"build": "poi build --format cjs",
"build:umd": "poi build --format umd",
"build:doc": "vue-styleguidist build",
"serve": "vue-styleguidist server"
},
Expand All @@ -25,7 +26,8 @@
"babel-preset-es2015": "^6.24.1",
"eslint": "^3.17.1",
"eslint-plugin-vue": "beta",
"vue-cli": "^2.8.2",
"node-glob": "^1.2.0",
"poi": "^9.3.10",
"vue-styleguidist": "^1.2.5",
"vue-webpack-loaders": "^1.0.6",
"webpack": "^3.1.0"
Expand Down
11 changes: 11 additions & 0 deletions template/poi.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const glob = require('glob').sync;
const {name} = require('./package.json');

module.exports = {
entry: glob('./src/**/*.vue'),
filename: {
js: name + '.min.js',
},
sourceMap: false,
html: false
};
11 changes: 0 additions & 11 deletions template/src/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion template/styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
/* The component itself */
name: '{{ name }}',
content: 'docs/Introduction.md',
components: 'src/**/{{ name }}.vue',
components: 'src/**/*.vue',
// ignore: ['src/ignored-component/ignored-component.vue'],
sections: [
/* One item for each demo or example of the component */
Expand Down

0 comments on commit 77e854f

Please sign in to comment.