From ab2cf728720f85153152501cb9bd934d7fa1e5d2 Mon Sep 17 00:00:00 2001 From: Filip Noetzel Date: Sun, 30 Mar 2025 10:16:34 +0200 Subject: [PATCH] move source to src/*.ts --- esbuild.config.js | 13 ++++--------- .../InteractiveRatingsPlugin.ts | 0 main.ts => src/main.ts | 0 utils.ts => src/utils.ts | 0 tsconfig.json | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) rename InteractiveRatingsPlugin.ts => src/InteractiveRatingsPlugin.ts (100%) rename main.ts => src/main.ts (100%) rename utils.ts => src/utils.ts (100%) diff --git a/esbuild.config.js b/esbuild.config.js index c8b9f24..77b04ce 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -13,7 +13,7 @@ const isWatch = process.argv.includes('--watch'); // Build configuration const buildOptions = { - entryPoints: ['main.ts'], + entryPoints: ['src/main.ts'], bundle: true, outfile: 'main.js', platform: 'browser', @@ -22,7 +22,7 @@ const buildOptions = { banner: { js: banner }, external: ['obsidian'], logLevel: 'info', - minify: process.env.NODE_ENV === 'production', + minify: false, treeShaking: true, }; @@ -31,13 +31,8 @@ function copyFiles() { // This would copy files if needed, but in this case manifest.json is already in the root console.log('Copying additional files...'); - // Copy styles.css if it exists - try { - fs.copyFileSync('styles.css', 'styles.css'); - console.log('Copied styles.css'); - } catch (err) { - // If it doesn't exist, that's fine - } + fs.copyFileSync('styles.css', 'styles.css'); + console.log('Copied styles.css'); } async function build() { diff --git a/InteractiveRatingsPlugin.ts b/src/InteractiveRatingsPlugin.ts similarity index 100% rename from InteractiveRatingsPlugin.ts rename to src/InteractiveRatingsPlugin.ts diff --git a/main.ts b/src/main.ts similarity index 100% rename from main.ts rename to src/main.ts diff --git a/utils.ts b/src/utils.ts similarity index 100% rename from utils.ts rename to src/utils.ts diff --git a/tsconfig.json b/tsconfig.json index fa7862e..4bb13c2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,6 @@ "pretty": true, "moduleResolution": "NodeNext" }, - "include": ["*.ts"], + "include": ["src/**/*.ts"], "exclude": ["node_modules", "dist"] } \ No newline at end of file