When the DCE plugin is enabled, kotlin-js-min/main is added to the webpack.config.js config. This can be seen on the 'frontend-only' example by invoking the run task. The bundle that's loaded, however, does not contain DCE'd user code. build/js/frontend-only.js contains a reference to Kotlin.defineModule('frontend-only', _); which has been removed from build/kotlin-js-min/kotlin.js. This causes a JS error when you load the development site.
Modification of the build configuration shouldn't be needed in order to create a production DCE'd bundle and to run a development non-DCE'd local build.
This has nothing to do with the dev server. Doing a normal 'bundle' will use the wrong JS file as the entry point (which contains the defineModule call) instead of the one in the DCE output folder.
When the DCE plugin is enabled,
kotlin-js-min/main
is added to thewebpack.config.js
config. This can be seen on the 'frontend-only' example by invoking therun
task. The bundle that's loaded, however, does not contain DCE'd user code.build/js/frontend-only.js
contains a reference toKotlin.defineModule('frontend-only', _);
which has been removed frombuild/kotlin-js-min/kotlin.js
. This causes a JS error when you load the development site.Modification of the build configuration shouldn't be needed in order to create a production DCE'd bundle and to run a development non-DCE'd local build.