Rename static directory to generated
This commit is contained in:
parent
bf75b84f3d
commit
f249ab2674
|
@ -5,3 +5,4 @@ todo.org
|
|||
node_modules
|
||||
static/scripts/dist
|
||||
static/templates/*
|
||||
generated/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[default]
|
||||
template_dir = "static/templates/"
|
||||
template_dir = "generated/templates/"
|
||||
|
||||
[development]
|
||||
address = "localhost"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"webpack-dev": "cd static/scripts && webpack serve --watch --inline --port 8081 --host 0.0.0.0 --output-path=./build",
|
||||
"webpack-dev": "webpack serve --watch --inline --port 8081 --host 0.0.0.0 --output-path=./build",
|
||||
"build:protobuf": "mkdir -p src/frontend/_proto && protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts -I ./proto --js_out=import_style=commonjs,binary:./src/frontend/_proto --ts_out=service=grpc-web:./src/frontend/_proto ./proto/*.proto",
|
||||
"build:webpack": "webpack"
|
||||
},
|
||||
|
|
|
@ -43,7 +43,7 @@ async fn make_rocket(database: sqlx::SqlitePool) -> Result<(), Box<dyn std::erro
|
|||
.mount("/api", api_routes)
|
||||
.mount(
|
||||
"/scripts",
|
||||
StaticFiles::from(concat!(env!("CARGO_MANIFEST_DIR"), "/static/scripts")),
|
||||
StaticFiles::from(concat!(env!("CARGO_MANIFEST_DIR"), "/generated/scripts")),
|
||||
)
|
||||
.mount(
|
||||
"/protos",
|
||||
|
|
|
@ -10,7 +10,7 @@ function packPage(page, chunks) {
|
|||
if (!chunks) chunks = [];
|
||||
return new HtmlWebpackPlugin({
|
||||
template: `${root}/src/frontend/templates/${page}`,
|
||||
filename: `${root}/static/templates/${page}`,
|
||||
filename: `${root}/generated/templates/${page}`,
|
||||
publicPath: '/scripts/dist',
|
||||
scriptLoading: 'defer',
|
||||
chunks: chunks,
|
||||
|
@ -31,7 +31,7 @@ module.exports = {
|
|||
},
|
||||
mode: "development",
|
||||
output: {
|
||||
path: `${root}/static/scripts/dist`,
|
||||
path: `${root}/generated/scripts/dist`,
|
||||
filename: '[name].bundle.js'
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
|
|
Loading…
Reference in New Issue