Skip to content

Commit 647e29e

Browse files
committed
Warn about /js/app.js being deprecated
1 parent da03fa4 commit 647e29e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cmd_start.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ pub fn command_start< 'a >( matches: &clap::ArgMatches< 'a > ) -> Result< (), Er
279279

280280
let _watcher = monitor_for_changes_and_rebuild( last_build.clone() );
281281

282+
let target_name = target.name.clone();
282283
let address = address_or_default( matches );
283284
let server = SimpleServer::new(&address, move |request| {
284285
let path = request.uri().path();
@@ -290,6 +291,12 @@ pub fn command_start< 'a >( matches: &clap::ArgMatches< 'a > ) -> Result< (), Er
290291
return response_from_data("application/text", data.into_bytes());
291292
}
292293

294+
if path == "/js/app.js" {
295+
eprintln!( "!!!!!!!!!!!!!!!!!!!!!" );
296+
eprintln!( "WARNING: `/js/app.js` is deprecated; you should update your HTML file to use `/{}.js` instead!", target_name );
297+
eprintln!( "!!!!!!!!!!!!!!!!!!!!!" );
298+
}
299+
293300
debug!( "Received a request for {:?}", path );
294301
if let Some( mut artifact ) = last_build.deployment.get_by_url(&path) {
295302
if auto_reload && (path == "/" || path == "/index.html") {

0 commit comments

Comments
 (0)