Commit 899fa3fe authored by Konrad Borowski's avatar Konrad Borowski

Bust cache

parent cff0b11c
Pipeline #88662495 passed with stage
in 11 minutes and 18 seconds
......@@ -2,3 +2,4 @@
**/*.rs.bk
node_modules
static/js
entry
......@@ -4326,6 +4326,12 @@
}
}
},
"webpack-stats-plugin": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/webpack-stats-plugin/-/webpack-stats-plugin-0.3.0.tgz",
"integrity": "sha512-4a6mEl9HLtMukVjEPY8QPCSmtX2EDFJNhDTX5ZE2CLch2adKAZf53nUrpG6m7NattwigS0AodNcwNxlu9kMSDQ==",
"dev": true
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
......
use ructe::Ructe;
use std::error::Error;
use std::fs;
use std::process::{Command, Stdio};
use walkdir::WalkDir;
......@@ -21,6 +22,10 @@ fn main() -> Result<(), Box<dyn Error>> {
}
run_command("npm install", "Installing npm modules failed");
run_command("node_modules/.bin/webpack", "Webpack failed");
println!(
"cargo:rustc-env=ENTRY_FILE_PATH={}",
fs::read_to_string("entry")?,
);
Ructe::from_env()
.unwrap()
.compile_templates("templates")
......
@()
</article>
<script src="/static/js/index.js"></script>
<script src="/@env!("ENTRY_FILE_PATH")"></script>
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin")
const { StatsWriterPlugin } = require("webpack-stats-plugin")
module.exports = {
entry: './js/index',
output: {
filename: 'static/js/index.js',
filename: 'static/js/[chunkhash].js',
path: __dirname,
},
module: {
......@@ -26,7 +27,7 @@ module.exports = {
new MonacoWebpackPlugin({
output: 'static/js',
languages: [
'csharp',
'csharp',
'cpp',
'html',
'java',
......@@ -42,5 +43,11 @@ module.exports = {
'typescript',
],
}),
new StatsWriterPlugin({
filename: 'entry',
transform(data) {
return data.assetsByChunkName.main
},
}),
],
}
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