From 32f871d1fa2309216e506baecbe1662273f128a6 Mon Sep 17 00:00:00 2001 From: Ken Eucker Date: Tue, 9 Jan 2024 09:49:49 -0800 Subject: [PATCH] fix(publish): tightens up the publish --- package.json | 8 ++++---- publish.config.ts | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7a5aa633..b308ea1f 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "lint:js": "eslint --ext .ts,.js,.vue src --fix", "lint:style": "stylelint \"./src/**/*.vue\" \"./src/**/*.scss\" --fix", "serve": "vite", - "pub:expose": "mv dist/index.d.ts ./index.d.ts && mv dist/biketag-vue.umd.js ./biketag-vue.umd.js && mv dist/biketag-vue.mjs ./biketag-vue.mjs && mv dist/style.css ./style.css && mv dist/components ./components && mv dist/common ./common && mv dist/store ./store", - "pub:clear": "rm ./index.d.ts ./biketag-vue.umd.js ./biketag-vue.mjs ./style.css && rm -rf ./components ./common ./store", + "pub:expose": "mv dist/index.d.ts ./index.d.ts && mv dist/biketag-vue.* ./ && mv dist/components ./components && mv dist/common ./common && mv dist/store ./store", + "pub:clear": "rm -f ./index.d.ts ./biketag-vue.es.js ./biketag-vue.css && rm -rf dist ./components ./common ./store", "pub:build": "vue-tsc && vite build --config publish.config.ts", "build": "vite build", "commit": "cz", @@ -145,8 +145,8 @@ ".": { "import": "./biketag-vue.es.js" }, - "./style.css": { - "import": "./style.css" + "./biketag-vue.css": { + "import": "./biketag-vue.css" } } } diff --git a/publish.config.ts b/publish.config.ts index e4a2959a..a97b216c 100644 --- a/publish.config.ts +++ b/publish.config.ts @@ -15,6 +15,10 @@ export default defineConfig({ rollupOptions: { external: ['vue'], output: { + assetFileNames: (assetInfo) => { + if (assetInfo.name === 'style.css') return 'biketag-vue.css' + return assetInfo.name! + }, // disable warning on src/index.ts using both default and named export exports: 'named', globals: {