Commit 308eb400 authored by Konrad Borowski's avatar Konrad Borowski

Dynamically retrieve JS path in debug builds

This allows to use webpack --watch
parent a0d33d58
Pipeline #96959718 passed with stage
in 8 minutes and 16 seconds
use std::borrow::Cow;
use std::fs;
pub fn path() -> Cow<'static, str> {
let path = env!("ENTRY_FILE_PATH");
let path = fs::read_to_string("entry").unwrap();
pub mod js;
pub mod language;
pub mod paste;
pub mod rejection;
......@@ -3,4 +3,4 @@
@(session: &Session)
<script src="/@env!("ENTRY_FILE_PATH")" nonce="@session.nonce"></script>
<script src="/@crate::models::js::path()" nonce="@session.nonce"></script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment