Skip to content

Commit 1785dd6

Browse files
committed
fix: use a module name placeholder for fragments
Because the server gives fragment modules a name on-the-fly (based on the fragment entry id) we cannot write any name during build time, so instead we write a placeholder (`__FRAGMENT_MODULE_NAME__`) that the server replaces by the real name when registering the AMD module in the `NPMRegistry`.
1 parent 405de1a commit 1785dd6

File tree

1 file changed

+1
-3
lines changed
  • packages/liferay-npm-bundler/src/adapt/liferay-fragment

1 file changed

+1
-3
lines changed

packages/liferay-npm-bundler/src/adapt/liferay-fragment/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ async function transformBundles(): Promise<void> {
3737

3838
const destFile = project.outputDir.join(moduleName);
3939

40-
const {name, version} = project.pkgJson;
41-
4240
await transformJsSourceFile(
4341
sourceFile,
4442
destFile,
45-
wrapModule(`${name}@${version}/${moduleName}`, {
43+
wrapModule(`__FRAGMENT_MODULE_NAME__`, {
4644
defineDependencies: {
4745
__MODULE__: 'module',
4846
__REQUIRE__: 'require',

0 commit comments

Comments
 (0)