diff --git a/extension/asset.go b/extension/asset.go index b962eecb..272cb940 100644 --- a/extension/asset.go +++ b/extension/asset.go @@ -20,8 +20,10 @@ func ConvertExtensionsToSources(ctx context.Context, extensions []Extension) []a } sources = append(sources, asset.Source{ - Name: name, - Path: ext.GetRootDir(), + Name: name, + Path: ext.GetRootDir(), + AdminEsbuildCompatible: ext.GetExtensionConfig().Build.Zip.Assets.EnableESBuildForAdmin, + StorefrontEsbuildCompatible: ext.GetExtensionConfig().Build.Zip.Assets.EnableESBuildForStorefront, }) extConfig := ext.GetExtensionConfig() @@ -35,8 +37,10 @@ func ConvertExtensionsToSources(ctx context.Context, extensions []Extension) []a } sources = append(sources, asset.Source{ - Name: bundleName, - Path: path.Join(ext.GetRootDir(), bundle.Path), + Name: bundleName, + Path: path.Join(ext.GetRootDir(), bundle.Path), + AdminEsbuildCompatible: ext.GetExtensionConfig().Build.Zip.Assets.EnableESBuildForAdmin, + StorefrontEsbuildCompatible: ext.GetExtensionConfig().Build.Zip.Assets.EnableESBuildForStorefront, }) } } diff --git a/extension/asset_test.go b/extension/asset_test.go index e734a13f..19ac53f7 100644 --- a/extension/asset_test.go +++ b/extension/asset_test.go @@ -9,7 +9,8 @@ import ( func TestConvertPlugin(t *testing.T) { plugin := PlatformPlugin{ - path: t.TempDir(), + path: t.TempDir(), + config: &Config{}, composer: platformComposerJson{ Extra: platformComposerJsonExtra{ ShopwarePluginClass: "FroshTools\\FroshTools", @@ -28,7 +29,8 @@ func TestConvertPlugin(t *testing.T) { func TestConvertApp(t *testing.T) { app := App{ - path: t.TempDir(), + path: t.TempDir(), + config: &Config{}, manifest: appManifest{ Meta: appManifestMeta{ Name: "TestApp", diff --git a/extension/project.go b/extension/project.go index 49d1aeb4..b800ace8 100644 --- a/extension/project.go +++ b/extension/project.go @@ -66,9 +66,18 @@ func FindAssetSourcesOfProject(ctx context.Context, project string) []asset.Sour logging.FromContext(ctx).Infof("Found bundle in project: %s (path: %s)", name, bundlePath) + bundleConfig, err := readExtensionConfig(bundlePath) + + if err != nil { + logging.FromContext(ctx).Errorf("Cannot read bundle config: %s", err.Error()) + continue + } + sources = append(sources, asset.Source{ - Name: name, - Path: path.Join(project, bundlePath), + Name: name, + Path: path.Join(project, bundlePath), + AdminEsbuildCompatible: bundleConfig.Build.Zip.Assets.EnableESBuildForAdmin, + StorefrontEsbuildCompatible: bundleConfig.Build.Zip.Assets.EnableESBuildForStorefront, }) } diff --git a/internal/asset/source.go b/internal/asset/source.go index 8f79f626..1568dc3f 100644 --- a/internal/asset/source.go +++ b/internal/asset/source.go @@ -1,6 +1,8 @@ package asset type Source struct { - Name string - Path string + Name string + Path string + AdminEsbuildCompatible bool + StorefrontEsbuildCompatible bool }