浏览代码

Use ES6 module output

For compatibility with top-level await in CX NPM package
Alessandro Pignotti 9 月之前
父节点
当前提交
4f13791f71
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      next.html
  2. 1 1
      rollup.config.js

+ 1 - 1
next.html

@@ -33,7 +33,7 @@
 	<!-- Serviceworker script that adds the COI and CORS headers to the response headers in cases where the server does not support it. -->
 	<script src="serviceWorker.js"></script>
 	<script src="network.js"></script>
-	<script defer src='/build/bundle.js'></script>
+	<script defer src='/build/bundle.js' type='module'></script>
 </head>
 
 <body>

+ 1 - 1
rollup.config.js

@@ -14,7 +14,7 @@ export default {
 	input: 'src/main.js',
 	output: {
 		sourcemap: true,
-		format: 'iife',
+		format: 'esm',
 		name: 'app',
 		file: 'build/bundle.js'
 	},