Skip to content

Instantly share code, notes, and snippets.

@lega911
Created June 18, 2021 20:32
Show Gist options
  • Save lega911/6d343a1be094569155613aefe397ad8e to your computer and use it in GitHub Desktop.
Save lega911/6d343a1be094569155613aefe397ad8e to your computer and use it in GitHub Desktop.
diff --git a/dist/static/index.html b/dist/static/index.html
index 889ce60..66c9f93 100644
--- a/dist/static/index.html
+++ b/dist/static/index.html
@@ -4,10 +4,10 @@
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Malina.js - import ES modules</title>
- <link rel="shortcut icon" href="./malinajs.svg">
- <link rel='stylesheet' href='./global.css'>
- <link rel='stylesheet' href='./build/bundle.css'>
- <script defer src='./build/bundle.js'></script>
+ <link rel="shortcut icon" href="/malinajs.svg">
+ <link rel='stylesheet' href='/global.css'>
+ <link rel='stylesheet' href='/build/main.css'>
+ <script type="module" src='/build/main.js'></script>
</head>
<body>
diff --git a/esbuild.js b/esbuild.js
index 5205906..21dcf61 100644
--- a/esbuild.js
+++ b/esbuild.js
@@ -75,7 +75,9 @@ async function build_client() {
return await build( {
entryPoints: [ 'src/client/main.js' ],
bundle: true,
- outfile: 'dist/static/build/bundle.js',
+ splitting: true,
+ outdir: 'dist/static/build',
+ format: 'esm',
sourcemap: DEV, // Use `DEV && 'inline'` to inline sourcemaps to the bundle
minify: !DEV,
incremental: DEV,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment