Skip to content

Commit

Permalink
Merge pull request #40 from ia3andy/asset-names
Browse files Browse the repository at this point in the history
Add assetNames support
  • Loading branch information
ia3andy authored Aug 22, 2023
2 parents e1315a2 + 33ec3f1 commit 6b0da0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/io/mvnpm/esbuild/model/EsBuildConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ enum Target {

private String entryNames;

private String assetNames;

private final List<String> external = new ArrayList<>();

public boolean isBundle() {
Expand Down Expand Up @@ -208,6 +210,14 @@ public void setEntryNames(String entryNames) {
this.entryNames = entryNames;
}

public String getAssetNames() {
return assetNames;
}

public void setAssetNames(String assetNames) {
this.assetNames = assetNames;
}

public List<String> getExternal() {
return external;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ private void initDefault() {
.sourceMap()
.splitting()
.entryNames("[name]-[hash]")
.assetNames("assets/[name]-[hash]")
.format(EsBuildConfig.Format.ESM)
.loader(getDefaultLoadersMap());
}
Expand Down Expand Up @@ -159,6 +160,11 @@ public EsBuildConfigBuilder entryNames(String template) {
return this;
}

public EsBuildConfigBuilder assetNames(String assetNames) {
esBuildConfig.setAssetNames(assetNames);
return this;
}

public EsBuildConfig build() {
return esBuildConfig;
}
Expand Down

0 comments on commit 6b0da0e

Please sign in to comment.