From f3f7ac61f36b297108c17db74d8b443edd525d78 Mon Sep 17 00:00:00 2001 From: Geoffrey Hendrey Date: Thu, 21 Mar 2024 11:14:45 -0700 Subject: [PATCH] .ts files in dist --- webpack.config.cjs.js | 15 +++++++++++++++ webpack.config.js | 14 ++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/webpack.config.cjs.js b/webpack.config.cjs.js index aa1ad4e8..06bcd015 100644 --- a/webpack.config.cjs.js +++ b/webpack.config.cjs.js @@ -69,6 +69,21 @@ export default { new webpack.DefinePlugin({ BUILD_TARGET: JSON.stringify('web'), }), +//make sure the .ts files go into dist for sourcemaps + new CopyPlugin({ + patterns: [ + { + from: 'src/**/*.ts', // Match only .ts files within the src directory + to: 'src/[name][ext]', // Copy to dist/src while retaining the file names and extensions + globOptions: { + ignore: [ + '**/test/**', // Exclude the src/test directory + ], + }, + }, + ], + }) + ], diff --git a/webpack.config.js b/webpack.config.js index 70040201..0e7c4e4d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -75,6 +75,20 @@ export default { new webpack.DefinePlugin({ BUILD_TARGET: JSON.stringify('web'), }), + //make sure the .ts files go into dist for sourcemaps + new CopyPlugin({ + patterns: [ + { + from: 'src/**/*.ts', // Match only .ts files within the src directory + to: 'src/[name][ext]', // Copy to dist/src while retaining the file names and extensions + globOptions: { + ignore: [ + '**/test/**', // Exclude the src/test directory + ], + }, + }, + ], + }) ],