Skip to content

Commit

Permalink
chore: add rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
visualjerk committed Jul 29, 2020
1 parent c7555d4 commit 3878800
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 272 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ coverage
.DS_Store
dist
*.local
.eslintcache
.eslintcache
lib
20 changes: 10 additions & 10 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
5 changes: 1 addition & 4 deletions examples/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
<TestButton @click="handleClick">
Button
</TestButton>
<TestButton
disabled
@click="handleClick"
>
<TestButton disabled @click="handleClick">
Button
</TestButton>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/src/TestButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script>
import { Clickable, clickableProps } from 'ari-vue/src/Clickable'
import { Clickable, clickableProps } from 'ari-vue'
export default {
name: 'TestButton',
Expand Down
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"name": "ari-vue",
"version": "0.0.0",
"license": "MIT",
"repository": "https://github.com/visualjerk/ari",
"main": "lib/index.js",
"module": "lib/index.es.js",
"author": {
"name": "Jörg Bayreuther",
"url": "https://github.com/visualjerk"
},
"scripts": {
"lint": "eslint . --ext js,ts,tsx,vue --fix",
"test": "jest"
"test": "jest",
"build": "rollup -c"
},
"peerDependencies": {
"vue": "^3.0.0-rc.3"
Expand All @@ -13,6 +22,8 @@
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@rollup/plugin-multi-entry": "^3.0.1",
"@rollup/plugin-typescript": "^5.0.2",
"@testing-library/dom": "^7.21.4",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/user-event": "^12.0.11",
Expand All @@ -29,6 +40,7 @@
"jest": "^26.1.0",
"lint-staged": ">=10",
"prettier": "^2.0.5",
"rollup": "^2.23.0",
"typescript": "^3.9.7",
"vue": "^3.0.0-rc.3"
},
Expand Down
24 changes: 24 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import multi from '@rollup/plugin-multi-entry'
import typescript from '@rollup/plugin-typescript'

export default {
input: 'src/**/index.ts',
output: [
{
file: 'lib/index.js',
format: 'cjs',
},
{
file: 'lib/index.es.js',
format: 'es',
},
],
plugins: [
multi(),
typescript({
exclude: '**/*.spec.tsx',
noEmitOnError: false,
}),
],
external: ['vue'],
}
Loading

0 comments on commit 3878800

Please sign in to comment.