-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error loading file from typescript package in bin folder due to IIS restriction (404s) #3408
Comments
One option is to rename I will check with IIS/ASP.net folks to see if there are other workarounds. |
@wforney are you saying here that a file |
yes, removing |
Here is what we can do with TypeScript npm package to unblock this scenario
var fs = require('fs');
var path = require('path');
var currentDirectory = process.cwd();
var distFolder = path.join(currentDirectory, "dist");
var files = fs.readdirSync(distFolder);
var binFolder = path.join(currentDirectory, "bin");
if (!fs.existsSync(binFolder)) {
fs.mkdirSync(binFolder);
}
files.forEach(function(f) {
var sourcePath = path.join(distFolder, f);
var targetPath = path.join(binFolder, f);
fs.linkSync(sourcePath, targetPath); // creating symlinks on Windows requires elevated permissions, in our case hardlinks will also work
}); This way we can be both backwards compatible in scenarios when somebody references @mhegazy does this solution work for you? |
fine by me. @billti any concerns/ideas? |
do we have to change |
@mhegazy if using overrides to specify different entry point does not put restrictions on some jspm scenarios we can do the other way around, keep everything in |
A canonical pattern for NPM modules is to have the command line in './bin' (i.e. the file we have at https://github.com/Microsoft/TypeScript/blob/master/bin/tsc ), and have the remainder of the content in a './lib' folder. We could leave the current files referenced by 'bin' entries in packageon.json there (i.e. I'm not a fan of running post install scripts to create folders or putting files for orthogonal technologies (i.e. ASP.NET) in our NPM package. How big do we expect the impact of the move will be without doing these? |
This issue came to light while trying to use this plugin for SystemJS... I filed an issue there and they suggested I also make one over here.
frankwallis/plugin-typescript#22 (comment)
The bin folder is blocked in IIS out of box so when installing your typescript plugin I got 404s when it attempted to download the typescript.js file from the bin folder of the typescript package... I'm not sure who publishes that or if you can work around it but it is a blocker for using this on IIS. Whoever maintains the typescript package you use should add a web.config allowing browsing of the bin folder or rename the bin folder something else that isn't blocked (preferred).
web.config contents to fix it below:
The text was updated successfully, but these errors were encountered: