Mario Loncar
07/20/2023, 10:35 AMCLOVIS
07/20/2023, 11:59 AMMario Loncar
07/20/2023, 12:01 PMCLOVIS
07/20/2023, 12:03 PMArtem Kobzar
07/21/2023, 9:19 AMCLOVIS
07/21/2023, 9:21 AMCLOVIS
07/21/2023, 9:21 AMArtem Kobzar
07/21/2023, 9:29 AMMario Loncar
07/21/2023, 9:35 AM#!/bin/bash
PACKAGE_ROOT=packages/js-package
echo "> Copy shared.js"
cp shared/build/distributions/shared.js $PACKAGE_ROOT/src
echo "> Copy types"
cp shared/build/compileSync/main/productionExecutable/kotlin/*-shared.d.ts $PACKAGE_ROOT/src/shared.d.ts
cd $PACKAGE_ROOT
echo "> Install dependencies"
npm install
echo "> Build"
npm run build
sorry for stupid questions. I do Android and iOS. quite new to web with multiplatform.Artem Kobzar
07/21/2023, 10:17 AMkotlin {
js(IR) {
useEsModules() // <- This one
// End if you have the next line
useCommonJs() // <- remove it
}
}
Mario Loncar
07/21/2023, 11:37 AMandylamax
07/21/2023, 11:43 AMI think it's the opposite, compiling into smaller files will make tree shaking harder than compiling into a single massive file.This is not entirely true. Tree shaking output is not impacted wether its a single large file, or many small files as long as the file(s) are ESX module(s) respectively, The number of files might impact speed during shaking but no the output size