trunk-rs/trunk

Avoiding inline script tag in built index.html

開放

#288 建立於 2021年12月24日

 (9 則留言) (4 個反應) (0 位負責人)Rust (315 個分叉)auto 404
enhancementhelp wanted

倉庫指標

星標
 (4,347 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

It would be great if it was possible to avoid having the

import init from '/index-....js';init('/index-..._bg.wasm');

part of the html in a separate file and load it as a module, similar to React's INLINE_RUNTIME_CHUNK=false

This is so allowing script-src 'unsafe-inline' can be avoided when setting Content Security Policy headers.

貢獻者指南