Skip to content

Commit

Permalink
Switch to ES modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Oct 24, 2024
1 parent f6d56c4 commit 6506f9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ outputs:
runs:
using: node20
main: build/distributions/index.js
main: build/distributions/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ val libs = the<LibrariesForLibs>()

kotlin {
js {
useCommonJs()
useEsModules()
binaries.executable()
nodejs()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ val libs = the<LibrariesForLibs>()

kotlin {
js {
useCommonJs()
useEsModules()
binaries.executable()
nodejs()
}
Expand Down Expand Up @@ -109,7 +109,7 @@ artifacts {
it
.destinationDirectory
.get()
.resolve("${project.name}.js")
.resolve("${project.name}.mjs")
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ suspend fun main() {
mkdir(output, jso<MakeDirectoryOptions> {
recursive = true
})
writeFile(path.join(output, "index.js"), result.code)
result.map?.also { writeFile(path.join(output, "index.js.map"), it) }
writeFile(path.join(output, "index.mjs"), result.code)
result.map?.also { writeFile(path.join(output, "index.mjs.map"), it) }

result.assets?.forEach { (assetFileName, asset) ->
val assetFilePath = path.join(output, assetFileName)
Expand Down

0 comments on commit 6506f9c

Please sign in to comment.