Skip to content

Commit 4c26ff3

Browse files
committed
Fix package building
1 parent 1a3149f commit 4c26ff3

File tree

6 files changed

+151
-168
lines changed

6 files changed

+151
-168
lines changed

lib/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
export {default as Sortable} from '../src/components/Sortable.vue'
1+
import Sortable from '../src/components/Sortable.vue'
2+
3+
4+
export { Sortable }

sortablejs-vue3-v0.1.2.tgz

6.42 KB
Binary file not shown.

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import HelloWorld from "./components/HelloWorld.vue";
5757
</details>
5858
<details>
5959
<summary>Code for the below demo</summary>
60+
<aside>Also available on <a href="https://github.com/MaxLeiter/sortablejs-vue3/blob/main/src/components/HelloWorld.vue">GitHub</a></aside>
6061
<pre>
6162
{{ `<script setup lang="ts">
6263
import Sortable from "./Sortable.vue";
@@ -225,7 +226,7 @@ main {
225226
226227
--fg: #2c3e50;
227228
--bg: #ecf0f1;
228-
--bg-emphasis: #bdc3c7;
229+
--bg-emphasis: #f5f7fa;
229230
230231
--border: #ccc;
231232
--border-radius: 4px;

tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
"esModuleInterop": true,
1313
"lib": ["esnext", "dom"],
1414
"skipLibCheck": true,
15+
"baseUrl": "./",
16+
"rootDir": "./",
1517
"declaration": true,
1618
"outDir": "dist",
1719
"allowSyntheticDefaultImports": true,
18-
"paths": {
19-
"@components/*": ["./src/components/*"]
20-
}
2120
},
2221
"include": ["src/**/*.ts", "src/**/*.vue", "lib/**/*.ts"],
2322
"references": [{ "path": "./tsconfig.node.json" }]

vite.config.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
import { defineConfig } from 'vite'
22
import vue from '@vitejs/plugin-vue'
33
import * as path from 'path'
4-
import typescript from 'rollup-plugin-typescript2';
5-
import { resolve } from 'path';
6-
import viteTsconfigPaths from 'vite-tsconfig-paths'
74

85
// https://vitejs.dev/config/
96
export default defineConfig({
10-
plugins: [vue(), viteTsconfigPaths()],
7+
plugins: [vue()],
118
resolve: {
129
dedupe: ['vue'],
10+
preserveSymlinks: false,
1311
},
12+
logLevel: 'info',
1413
build: {
14+
target: 'esnext',
15+
minify: 'terser',
1516
lib: {
1617
entry: path.resolve(__dirname, 'lib/main.ts'),
1718
name: 'SortableJS-Vue3',
1819
fileName: (format) => `sortablejs-vue3.${format}.js`
1920
},
20-
rollupOptions: {
2121

22+
rollupOptions: {
2223
// make sure to externalize deps that shouldn't be bundled
2324
// into your library
2425
external: ['vue', 'sortablejs'],
@@ -30,10 +31,6 @@ export default defineConfig({
3031
sortablejs: 'Sortable'
3132
}
3233
},
33-
input: 'lib/main.ts',
34-
plugins: [
35-
typescript()
36-
]
3734
}
3835
}
3936
})

0 commit comments

Comments
 (0)