Skip to content
Snippets Groups Projects
Commit 37527ef7 authored by Julian's avatar Julian
Browse files

Use vite for building

parent c85e6eba
No related branches found
No related tags found
1 merge request!2Resolve "Implement basic functionality"
Pipeline #114402 failed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "vue-draggable-grid", "name": "vue-draggable-grid",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"build": "rollup -c", "build": "vite build",
"example:build": "vite build example", "example:build": "vite build example",
"example:dev": "vite example", "example:dev": "vite example",
"example:preview": "vite preview example --port 4173", "example:preview": "vite preview example --port 4173",
......
import vue from "rollup-plugin-vue"; // vite.config.js
import vue from "@vitejs/plugin-vue2";
import { defineConfig } from "vite";
import { resolve } from "path";
import peerDepsExternal from "rollup-plugin-peer-deps-external"; import peerDepsExternal from "rollup-plugin-peer-deps-external";
export default [ export default defineConfig({
{ plugins: [vue(), peerDepsExternal()],
input: "src/index.js", build: {
lib: {
/* eslint-env node */
entry: resolve(__dirname, "src/index.js"),
name: "vue-draggable-grid",
},
output: [ output: [
{ {
format: "esm", format: "esm",
...@@ -14,6 +22,12 @@ export default [ ...@@ -14,6 +22,12 @@ export default [
file: "dist/vue-draggable-grid.js", file: "dist/vue-draggable-grid.js",
}, },
], ],
plugins: [vue(), peerDepsExternal()], rollupOptions: {
output: {
globals: {
vue: "Vue",
},
},
},
}, },
]; });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment