Skip to content

Commit 621f65c

Browse files
Added fix to build libs as esm for frontend and retain cjs for backend (#646) (#648)
(cherry picked from commit 1ba1bf5) Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com>
1 parent b975d70 commit 621f65c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Frontend/implementations/typescript/webpack.base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
/node_modules/,
3333
],
3434
options: {
35-
configFile: "tsconfig.cjs.json"
35+
configFile: "tsconfig.esm.json"
3636
}
3737
},
3838
{

SignallingWebServer/platform_scripts/bash/common.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,14 @@ function setup_frontend() {
224224
if [ ! -d "${WEBPACK_OUTPUT_PATH}" ] || [ "$BUILD_FRONTEND" == "1" ] ; then
225225
echo "Building Typescript Frontend."
226226
# Using our bundled NodeJS, build the web frontend files
227+
pushd "${SCRIPT_DIR}/../../../Common" > /dev/null
228+
npm run build:esm
229+
popd > /dev/null
227230
pushd "${SCRIPT_DIR}/../../../Frontend/library" > /dev/null
228-
npm run build:cjs
231+
npm run build:esm
229232
popd > /dev/null
230233
pushd "${SCRIPT_DIR}/../../../Frontend/ui-library" > /dev/null
231-
npm run build:cjs
234+
npm run build:esm
232235
popd > /dev/null
233236
pushd "${SCRIPT_DIR}/../../../Frontend/implementations/typescript" > /dev/null
234237
npm run build:dev

SignallingWebServer/platform_scripts/cmd/common.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,17 @@ IF "%BUILD_FRONTEND%"=="1" (
216216
rem We could replace this all with a single npm script that does all this. we do have several build-all scripts already
217217
rem but this does give a good reference about the dependency chain for all of this.
218218
echo Building Typescript frontend...
219+
pushd %CD%\Common
220+
call %NPM% run build:esm
221+
popd
219222
pushd %CD%\Frontend\library
220-
call %NPM% run build:cjs
223+
call %NPM% run build:esm
221224
popd
222225
pushd %CD%\Frontend\ui-library
223-
call %NPM% run build:cjs
226+
call %NPM% run build:esm
224227
popd
225228
pushd %CD%\Frontend\implementations\typescript
229+
rem Note: build:dev implicitly uses esm deps due to node16/bundler module resolution
226230
call %NPM% run build:dev
227231
popd
228232
popd

0 commit comments

Comments
 (0)