Skip to content

Commit

Permalink
fix!: fixed last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Enderchief committed Dec 29, 2023
1 parent fdb4c75 commit 2bf9218
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "esgleam"
version = "0.2.0"
version = "0.2.1"
gleam = ">= 0.32.0"

description = "esbuild for Gleam"
Expand Down
16 changes: 1 addition & 15 deletions src/esgleam.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import gleam/io
import gleam/string
import gleam/list
import gleam/option.{type Option, None, Some}
import gleam/regex
import gleam/result
import gleam/string_builder.{append}
import simplifile
Expand Down Expand Up @@ -118,23 +117,10 @@ pub fn bundle(config: Config) {
}

fn do_bundle(config: Config) {
let assert Ok(project_name) =
simplifile.read("./gleam.toml")
|> result.map(with: fn(file) {
let assert Ok(re) = regex.from_string("name *= *\"(\\w[\\w_]*)\"")
let assert Ok(match) =
regex.scan(re, file)
|> list.first

let assert Ok(first_maybe) = list.first(match.submatches)
let assert Some(name): Option(String) = first_maybe
name
})

let entries =
list.map(config.entry_points, fn(entry) {
"./build/dev/javascript/"
<> project_name
<> internal.get_project_name()
<> "/"
<> string.replace(entry, ".gleam", with: ".mjs")
})
Expand Down

0 comments on commit 2bf9218

Please sign in to comment.