From e26b44618ac2f393098cf41a4675c71c0121254f Mon Sep 17 00:00:00 2001 From: evillt Date: Fri, 1 Oct 2021 21:06:21 +0800 Subject: [PATCH] chore: release v0.12.0 --- package.json | 2 +- vite.config.ts | 43 +++++++++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 8a72783..abef464 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macmineable", - "version": "0.11.3", + "version": "0.12.0", "scripts": { "dev": "vite", "build": "vite build", diff --git a/vite.config.ts b/vite.config.ts index 968be59..af0f2e6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,18 +1,37 @@ -import { defineConfig } from 'vite' +import { defineConfig, UserConfig } from 'vite' import { svelte } from '@sveltejs/vite-plugin-svelte' import path from 'path' import sveltePreprocess from 'svelte-preprocess' // https://vitejs.dev/config/ -export default defineConfig({ - root: 'client', - build: { - outDir: path.join(__dirname, 'dist'), - emptyOutDir: true, - }, - plugins: [ - svelte({ - preprocess: sveltePreprocess(), - }), - ], +export default defineConfig(({ command }) => { + const config: UserConfig = { + root: 'client', + build: { + outDir: path.join(__dirname, 'dist'), + emptyOutDir: true, + }, + resolve: { + alias: {} + }, + plugins: [ + svelte({ + preprocess: sveltePreprocess(), + }), + ], + } + + if (command !== 'build') { + config.resolve.alias = [ + { + find: /^@svelte-use\/(.*)/, + replacement: path.resolve( + __dirname, + '../../../dev/svelte-use/packages/$1/dist/index.mjs', + ), + }, + ] + } + + return config })