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

Usar Rollup + Bublé no bundle e configurar as saídas #2

Merged
merged 3 commits into from
May 23, 2019
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
5 changes: 0 additions & 5 deletions babel.config.js

This file was deleted.

6,540 changes: 1,337 additions & 5,203 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 28 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
"name": "@estudiorilo/stab",
"version": "0.1.4",
"private": false,
"main": "./dist/stab.common.js",
"cdn": "dist/stab.umd.js",
"main": "dist/stab.cjs.js",
"unpkg": "dist/stab.umd.js",
"module": "dist/stab.esm.js",
"jsdelivr": "dist/stab.umd.js",
"umd:main": "dist/stab.umd.js",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-bundle": "vue-cli-service build --target lib --name stab ./src/components/index.js"
},
"dependencies": {
"core-js": "^2.6.5",
"vue": "^2.6.10"
"build": "bili"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.7.0",
"@vue/cli-service": "^3.7.0",
"autoprefixer": "^9.5.1",
"bili": "^4.8.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.5.21"
"rollup-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.6.10"
},
"repository": {
"type": "git",
Expand All @@ -38,6 +37,23 @@
"autoprefixer": {}
}
},
"bili": {
"input": "src/index.js",
"output": {
"target": "browser",
"moduleName": "stab",
"fileName": "stab[min].[format].js",
"format": ["esm", "cjs", "umd", "umd-min"]
},
"plugins": {
"vue": {
"css": false
}
},
"babel": {
"minimal": true
}
},
"browserslist": [
"> 1%",
"last 2 versions"
Expand Down
27 changes: 27 additions & 0 deletions src/components/StabLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<component
v-bind="attrs"
v-on="$listeners"
:is="isExternal ? 'a' : 'router-link'"
:to="isExternal ? undefined : to"
:href="isExternal ? to : undefined"
:target="isExternal ? '_blank' : undefined"
>
<slot/>
</component>
</template>

<script>
export default {
props: {
to: String,
isExternal: String
},
computed: {
attrs() {
const { href: _, ...attrs } = this.$attrs;
return attrs;
}
}
};
</script>
16 changes: 2 additions & 14 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
import stabContainer from './StabContainer';

export const StabContainer = stabContainer;

const components = {
StabContainer
};

export default {
install(Vue) {
Object.keys(components)
.forEach(name => Vue.component(name, components[name]))
}
}
export { default as StabContainer } from './StabContainer.vue';
export { default as StabLink } from './StabLink.vue';
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components';
8 changes: 0 additions & 8 deletions src/main.js

This file was deleted.