From 8a73b140c47c249c29e2c926107c23a49e73e2d4 Mon Sep 17 00:00:00 2001 From: Terry Yiu Date: Tue, 8 Sep 2026 09:33:59 +0300 Subject: [PATCH] Stop tracking moko-resources generated webpack/karma config These config.d fragments are regenerated identically by the moko-resources Gradle plugin on every build, so they're build output rather than source. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp --- .gitignore | 5 +++ .../moko-resources-generated.js | 21 ---------- .../moko-resources-generated.js | 39 ------------------- 3 files changed, 5 insertions(+), 60 deletions(-) delete mode 100644 webApp/karma.config.d/moko-resources-generated.js delete mode 100644 webApp/webpack.config.d/moko-resources-generated.js diff --git a/.gitignore b/.gitignore index a42c540..8399051 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,8 @@ iOSInjectionProject/ # gradle properties local.properties +# moko-resources regenerates these webpack/karma config fragments on every build (verified +# byte-for-byte reproducible), so they're build output, not source. +karma.config.d/ +webpack.config.d/ + diff --git a/webApp/karma.config.d/moko-resources-generated.js b/webApp/karma.config.d/moko-resources-generated.js deleted file mode 100644 index 7ca093d..0000000 --- a/webApp/karma.config.d/moko-resources-generated.js +++ /dev/null @@ -1,21 +0,0 @@ -// workaround from https://github.com/ryanclark/karma-webpack/issues/498#issuecomment-790040818 - -const output = { - path: require("os").tmpdir() + '/' + '_karma_webpack_' + Math.floor(Math.random() * 1000000), -} - -const optimization = { - runtimeChunk: true -} - -config.set( - { - webpack: {... createWebpackConfig(), output, optimization}, - files: config.files.concat([{ - pattern: `${output.path}/**/*`, - watched: false, - included: false, - }] - ) - } -) \ No newline at end of file diff --git a/webApp/webpack.config.d/moko-resources-generated.js b/webApp/webpack.config.d/moko-resources-generated.js deleted file mode 100644 index ec85a79..0000000 --- a/webApp/webpack.config.d/moko-resources-generated.js +++ /dev/null @@ -1,39 +0,0 @@ -// noinspection JSUnnecessarySemicolon -;(function(config) { - const path = require('path'); - const MiniCssExtractPlugin = require('mini-css-extract-plugin'); - - config.module.rules.push( - { - test: /\.(.*)/, - resource: [ - path.resolve(__dirname, "kotlin/assets"), - path.resolve(__dirname, "kotlin/files"), - path.resolve(__dirname, "kotlin/images"), - path.resolve(__dirname, "kotlin/localization"), - ], - type: 'asset/resource' - } - ); - - config.plugins.push(new MiniCssExtractPlugin()) - config.module.rules.push( - { - test: /\.css$/, - resource: [ - path.resolve(__dirname, "kotlin/fonts"), - ], - use: ['style-loader', 'css-loader'] - } - ) - - config.module.rules.push( - { - test: /\.(otf|ttf)?$/, - resource: [ - path.resolve(__dirname, "kotlin/fonts"), - ], - type: 'asset/resource', - } - ) -})(config); \ No newline at end of file