Skip to content

Commit ee86939

Browse files
feanilclaude
andcommitted
fix: Build frontend package before publishing to npm
The package was shipping raw JSX (main: src/index.jsx) which webpack in MFE builds cannot process since babel-loader excludes node_modules by default. Follows the same pattern as @openedx/frontend-plugin-framework: - Use fedx-scripts babel to compile src/ -> dist/ before publishing - Set main to dist/index.js - Add files: ["dist"] to publish only compiled output - Add @openedx/frontend-build as a devDependency for fedx-scripts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c8c3634 commit ee86939

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ jobs:
115115

116116
- name: Update the package version and publish
117117
run: |
118+
npm install --include=dev
118119
npm version ${{ needs.release.outputs.version }}
120+
npm run build
119121
npm publish
120122
working-directory: './frontend'

frontend/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
{
22
"name": "@openedx/sample-plugin",
33
"version": "__semantically__released__",
4-
"main": "src/index.jsx",
4+
"main": "dist/index.js",
5+
"files": ["dist"],
56
"repository": "https://github.com/openedx/sample-plugin",
7+
"scripts": {
8+
"build": "fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.js"
9+
},
610
"peerDependencies": {
711
"@edx/frontend-platform": "*",
812
"@openedx/paragon": "*",
913
"react": "*"
14+
},
15+
"devDependencies": {
16+
"@openedx/frontend-build": "*"
1017
}
1118
}

0 commit comments

Comments
 (0)