From 3dce55ef99e443a2bb08a7d73327a9d7aacab999 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Aug 2023 18:52:16 +0900 Subject: [PATCH] fixed rollup assets clean pattern to properly preserve static files and del all else. --- .config/vite.config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/vite.config.js b/.config/vite.config.js index 7f5dade..5ba1825 100644 --- a/.config/vite.config.js +++ b/.config/vite.config.js @@ -26,7 +26,7 @@ export default { }, }, build: { - sourcemap: true, + sourcemap: process.env.NODE_ENV != 'production', rollupOptions: { input: { bundle: resolve(__dirname, '../src/main.js'), @@ -41,9 +41,12 @@ export default { }, plugins: [ process.env.NODE_ENV == 'production' && - del({ - targets: ['../shopify/assets/**/*', '!../shopify/assets/*static*'], - }), + del({ + targets: [ + resolve(__dirname, '../shopify/assets/!(*.static.*)'), + ], + verbose: true + }), ], }, outDir: resolve(__dirname, '../shopify/assets'),