Skip to content

Commit 45ea6a0

Browse files
committed
feat: Move to Module Federation for loaded components
feat: Ruffle embed for NG runs
1 parent ccb7a61 commit 45ea6a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+17434
-8204
lines changed

extensions/core-nga/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
2-
static/components.js
2+
static/*.js
3+
static/mf*.json

extensions/core-nga/gulpfile.js

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const gulp = require('gulp');
44
const zip = require('gulp-zip');
55
const merge = require('merge-stream');
66
const esbuild = require('esbuild');
7+
const { build: rslibBuild, loadConfig } = require('@rslib/core');
78

89
const filesToCopy = [
910
'extension.js',
@@ -13,30 +14,23 @@ const filesToCopy = [
1314
'README.md'
1415
];
1516

16-
function build(done) {
17-
esbuild.build({
17+
async function build(done) {
18+
// Build main extension (Node.js)
19+
const nodeBuild = esbuild.build({
1820
bundle: true,
1921
entryPoints: ['./src/extension.ts'],
2022
outfile: './dist/extension.js',
2123
platform: 'node',
22-
external: ['flashpoint-launcher', '*.css'],
23-
})
24+
external: ['flashpoint-launcher'],
25+
});
26+
27+
const config = await loadConfig('./rslib.config.ts');
28+
29+
Promise.all([nodeBuild, rslibBuild({
30+
...config.content,
31+
mode: 'development'
32+
})])
2433
.catch(console.error)
25-
.then(async () => {
26-
try {
27-
return await esbuild.build({
28-
bundle: true,
29-
entryPoints: ['./src/components.ts'],
30-
outfile: './static/components.js',
31-
format: 'esm',
32-
target: ['es2020'],
33-
platform: 'browser',
34-
external: ['flashpoint-launcher', '*.css'],
35-
});
36-
} catch (message) {
37-
return console.error(message);
38-
}
39-
})
4034
.finally(done);
4135
}
4236

0 commit comments

Comments
 (0)