T1
console.log('c')
<script type="module">
console.log('a')
</script>
<script>
console.log('b')
</script>
T2 - демо в реальном применении
console.log(!!window['$'], '$', 'JavaScript')
<script type="module"> // umdLibLoader.js
import 'https://unpkg.com/jquery'
</script>
<script type="module">
console.log(!!window['$'], '$', 'script type="module"')
</script>
<script>
console.log(!!window['$'], '$', 'script')
</script>
ожидаемое поведение
код в блоке language: lang-js
будет работать как в script type="module"
предлагаю
добавить "галочку" type="module"
для блока language: lang-js
доводы ЗА ввод "галочки"
- это удобно, логично, ... .
- скоро должны "подвезти" top level
await
...- https://github.com/tc39/proposal-top-level-await
Status: Stage 3
- https://github.com/tc39/proposal-top-level-await
type="module"
для блокаlanguage: lang-js