diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 207be043d..009e459df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: cache: 'pnpm' - name: Build WASM - run: make wasm + run: pnpm build - name: Install NPM Dependencies run: pnpm install diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ecce8932..100fd8561 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: cache: 'pnpm' - name: Build WASM - run: make wasm + run: pnpm build - name: Install NPM Dependencies run: pnpm install diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..f3b569056 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +shell-emulator=true \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 94ec38338..000000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -GO_FLAGS += "-ldflags=-s -w" - -# Avoid embedding the build path in the executable for more reproducible builds -GO_FLAGS += -trimpath - - -wasm: internal/*/*.go go.mod - CGO_ENABLED=0 GOOS=js GOARCH=wasm go build $(GO_FLAGS) -o ./packages/compiler/wasm/astro.wasm ./cmd/astro-wasm/astro-wasm.go - - -publish-node: - make wasm - cd packages/compiler && pnpm run build - -clean: - git clean -dxf diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 0a6274018..67f5d0f63 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -218,6 +218,9 @@ func (p *printer) printDefineVarsOpen(n *astro.Node) { if !(n.DataAtom == atom.Script || n.DataAtom == atom.Style) { return } + if n.DataAtom == atom.Style && transform.HasAttr(n, "is:inline") { + return + } if !transform.HasAttr(n, "define:vars") { return } diff --git a/internal/printer/printer_test.go b/internal/printer/printer_test.go index bbcfb40cb..728dcc3b5 100644 --- a/internal/printer/printer_test.go +++ b/internal/printer/printer_test.go @@ -3285,6 +3285,13 @@ const items = ["Dog", "Cat", "Platipus"]; definedVars: []string{"{color:'green'}"}, }, }, + { + name: "style is:inline define:vars", + source: "", + want: want{ + code: ``, + }, + }, { name: "define:vars on script with StaticExpression turned on", // 1. An inline script with is:inline - right diff --git a/package.json b/package.json index 4c3d07287..9340a8c96 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/withastro/compiler.git" }, "scripts": { - "build": "make wasm", + "build": "CGO_ENABLED=0 GOOS=js GOARCH=wasm go build \"-ldflags=-s -w\" -trimpath -o ./packages/compiler/wasm/astro.wasm ./cmd/astro-wasm/astro-wasm.go", "build:compiler": "pnpm --filter @astrojs/compiler run build", "build:all": "pnpm run build && pnpm run build:compiler", "lint": "eslint \"packages/**/src/**/*.{cjs,js,jsx,mjs,ts,tsx}\"",