hfhbd
03/25/2024, 5:55 PMcreateDistribution
or similar:
js {
binaries.executable()
useEsModules()
nodejs {
distribution {
distributionName.set("myFile.mjs")
outputDirectory.set(layout.projectDirectory.dir("myDist"))
}
}
}
Edoardo Luppi
03/25/2024, 6:06 PMjsNodeProductionLibraryDistribution
, for exampleEdoardo Luppi
03/25/2024, 6:07 PMEdoardo Luppi
03/25/2024, 6:07 PMhfhbd
03/25/2024, 6:09 PMEdoardo Luppi
03/25/2024, 6:12 PMexecutable()
is correct. Running the typical Gradle build
will invoke jsProductionExecutableCompileSync
, which will output:Edoardo Luppi
03/25/2024, 6:12 PMwhole-program
granularity to get a single JS file I suppose.hfhbd
03/25/2024, 6:16 PMwhole-program
should only merge all .mjs
(from productionExecutable) into one big .mjs
, right? It still does not merge npm dependencies?hfhbd
03/25/2024, 6:16 PMwhole-program
I still get import com_github_actions_github_y1dwzy from '@actions/github';
resulting into a runtime error due unresolved files.Edoardo Luppi
03/25/2024, 6:18 PM@actions/github
be available where you deploy the JS code?Edoardo Luppi
03/25/2024, 6:20 PMEdoardo Luppi
03/25/2024, 6:20 PMhfhbd
03/25/2024, 6:24 PMhfhbd
03/25/2024, 6:25 PMRobert Jaros
03/25/2024, 6:26 PMEdoardo Luppi
03/25/2024, 6:26 PMRobert Jaros
03/25/2024, 6:27 PMEdoardo Luppi
03/25/2024, 6:27 PMRobert Jaros
03/25/2024, 6:28 PMRobert Jaros
03/25/2024, 6:28 PMRobert Jaros
03/25/2024, 6:30 PMEdoardo Luppi
03/25/2024, 6:33 PMexternals
to remove modules.Edoardo Luppi
03/25/2024, 6:36 PMhfhbd
03/25/2024, 8:18 PMhfhbd
03/25/2024, 8:19 PMEdoardo Luppi
03/25/2024, 8:19 PMEdoardo Luppi
03/25/2024, 8:20 PMhfhbd
03/25/2024, 8:21 PMhfhbd
03/25/2024, 8:21 PMEdoardo Luppi
03/25/2024, 8:23 PMhfhbd
03/25/2024, 8:23 PMhfhbd
03/25/2024, 8:23 PMEdoardo Luppi
03/25/2024, 8:25 PMEdoardo Luppi
03/25/2024, 8:27 PMEdoardo Luppi
03/25/2024, 8:36 PMhfhbd
03/25/2024, 9:38 PMtype = module
which also causes problems with the generated webpack config file because this config isn't ES compatible. And I can't hack it, this needs some changes in KGP. Will create an issue tomorrow.Edoardo Luppi
03/25/2024, 10:02 PMwebpack.config.d
to modify the config object?hfhbd
03/26/2024, 9:19 AMEdoardo Luppi
03/26/2024, 9:32 AM