---
title: "Resilient Import Maps - Better Theme Development and Beyond"
description: "Shopify worked with browser vendors to change the HTML spec, Chromium and WebKit so import maps no longer break when JavaScript modules load before them or when a page has more than one map."
url: "https://swe.quest/articles/resilient-import-maps-better-theme-development-and-beyond-6678d102dbdca2c3"
canonical: "https://shopify.engineering/resilient-import-maps"
source: "Shopify Engineering"
published: "2025-05-28"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["browsers","javascript","web-performance","caching","frontend"]
---

# Resilient Import Maps - Better Theme Development and Beyond

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2025-05-28, 7 min read, Case study. Original: [https://shopify.engineering/resilient-import-maps](https://shopify.engineering/resilient-import-maps)

## Summary

Shopify worked with browser vendors to change the HTML spec, Chromium and WebKit so import maps no longer break when JavaScript modules load before them or when a page has more than one map. Each document keeps a single global import map and a set of already-resolved module names. Each new map is merged in, dropping any rule that would change an already-resolved module or override an existing rule. The change ships in Chrome 133 and Safari 18.4, and es-module-shims 2.4.0+ polyfills it for older browsers. Shopify injects the polyfill on storefronts automatically, so themes and app blocks can now use hashed, immutably cached modules without load-order conflicts.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Web performance](https://swe.quest/tags/web-performance.md) (Web & mobile)
- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)

## Prerequisites

- JavaScript ES modules ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- HTTP caching and content hashing ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))

## Keywords

import maps, ES modules, Chromium, WebKit, HTML spec, es-module-shims, Shopify themes

## Related posts

- [Shipping support for module script integrity in Chrome & Safari](https://swe.quest/articles/shipping-support-for-module-script-integrity-in-chrome-safari-1f1be3d6d912771d.md): Shopify Engineering · 2024-08-02 · Easy · 3 min read · Browsers, Application security, JavaScript, Open source
  Subresource Integrity previously covered only top-level scripts, styles and preloads, not imported ES modules, which forced Shopify's PCI-compliant checkout to shim dynamic imports.
- [What we got wrong about HTTP imports](https://swe.quest/articles/what-we-got-wrong-about-http-imports-313ba3cefc7f7089.md): Deno · 2024-07-29 · Easy · 6 min read · JavaScript, Build systems, TypeScript
  Deno's original module system of direct HTTP URL imports didn't scale.
- [Bun v1.1.44](https://swe.quest/articles/bun-v1-1-44-d312dca6375cbc2a.md): Bun · 2025-01-16 · Medium · 6 min read · JavaScript, Runtimes & VMs, Build systems, Frontend
  Bun v1.1.44 adds experimental HTML imports (behind --experimental-html) so Bun.serve() can bundle and serve frontend apps on demand alongside API routes, with no hot module reloading yet.
- [Fixing Top-Level Await in Safari](https://swe.quest/articles/fixing-top-level-await-in-safari-4919b25f6b19644e.md): WebKit · 2026-09-02 · Medium · 7 min read · JavaScript, Runtimes & VMs, Browsers, Testing
  Safari 27 fixes long-standing top-level await bugs, such as spurious "accessed before initialization" errors and wrong import completion order, by rewriting WebKit's ES module loader from scratch.
- [Bun v0.7.1](https://swe.quest/articles/bun-v0-7-1-5c9040e5c49cc1d7.md): Bun · 2023-07-29 · Medium · 8 min read · JavaScript, Runtimes & VMs, Performance engineering
  Bun v0.7.1 makes ES Module loading 30%–250% faster by running its transpiler concurrently for import statements and dynamic imports, though CommonJS require is still sequential.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
