Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Commented Feature: Allow setting non-js files as the startup file. [1008]

$
0
0
The express-generator utility creates a JavaScript file with no extension that is supposed to be used to launch the project:

Contents of `bin\www`:
```
#!/usr/bin/env node
var debug = require('debug')(Test');
var app = require('../app');

app.set('port', process.env.PORT || 3000);

var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port);
});
```

Because it does not have a .js extension, the UI does not allow selecting as the startup file.

We should allow selecting either any file, any extensionless file, or any file containing a node shebang line, as the startup file.
Comments: I am not convinced that this is the correct path. The files won't be recognized as JavaScript which means, while they would start up, they wouldn't have the language service or other shiny features to help with editing. I am also not sure the experience is desirable. With this, a user could change their startup file to nearly anything most of which won't run. The only usage for this is for the files missing the *.js style and that this project generates as if it was a script for Linux. I believe if the user really wants it to be a startup file it would be better if they could edit project properties (similar to languages like C#) to specify the launch executable there. This grants the same flexibility without adding a context menu item to (nearly) every file in the solution.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>