Skip to content

Fix "export" statements on packages #15

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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node_modules/
/tests/e2e/demo/public/browser/dist/
/tests/e2e/videos/
/tests/e2e/screenshots/
/tests/e2e/fixtures/public/packages/
/tests/unit/coverage/
jsconfig.json

Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules/**
/dist/**
/tests/e2e/demo/public/browser/dist/**
/packages/**
/tests/e2e/fixtures/public/packages/**
/tests/unit/coverage/**
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"emmet.includeLanguages": {
"vue-html": "html"
},
"vetur.grammar.customBlocks": {
"example": "html",
"meta": "json"
},

// ===
// JS(ON)
Expand Down
45 changes: 8 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Or, if you only want to use a small subset of components, drop them in individua
</div>

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/hello-vue-components/dist/HelloA/index.umd.min.js"></script>
<script src="https://unpkg.com/hello-vue-components/dist/HelloB/index.umd.min.js"></script>
<script src="https://unpkg.com/hello-vue-components/HelloA"></script>
<script src="https://unpkg.com/hello-vue-components/HelloB"></script>
<script>
new Vue({ el: '#app' })
</script>
```

### In a module system (without Vue CLI)
### In a module system

Install the library with NPM:

Expand All @@ -63,44 +63,15 @@ export default {
}
```

Or, if you only want to use a small subset of components, import individually bundled components from the `dist` directory to reduce the size of your application:
#### Individually packaged components

```js
import HelloA from 'hello-vue-components/dist/HelloA'
import HelloB from 'hello-vue-components/dist/HelloB'
```

### In a module system (with Vue CLI)

> If using Vue CLI 3 with Babel or TypeScript, it's recommended that you import the library from its `src` directory. This will minimize the size of your application by preventing duplicate or unnecessary polyfills.

Install the library with NPM:
If you only want to use a small subset of components, only import individually packaged components to reduce the size of your application:

```bash
npm install hello-vue-components
```

Then register the library as a plugin to globally install all components:

```js
import HelloVueComponents from 'hello-vue-components/src'

Vue.use(HelloVueComponents)
```

Or, import components individually for local registration:

```js
import { HelloA, HelloB } from 'hello-vue-components/src'

export default {
components: { HelloA, HelloB }
}
npm install hello-vue-components.hello-a hello-vue-components.hello-b
```

Or, if you only want to use a small subset of components, import individually bundled components from the `src` directory to reduce the size of your application:

```js
import HelloA from 'hello-vue-components/src/HelloA'
import HelloB from 'hello-vue-components/src/HelloB'
import HelloA from 'hello-vue-components.hello-a'
import HelloB from 'hello-vue-components.hello-b'
```
Loading