angular project .js file generation configuration option - javascript

Please see this image. I see a constants.js file and "js.map" file under the constants.ts file. while I see no js file for other ts files. I understand that the type script compiler will generate the js file for each ts file. I am not sure why I can not see all the js files. I am not sure which configuration setting is affecting this. project is under source control. I only want to commit to the .ts files. I need to stop any ".js" or "js.map" files from being generated. not sure why it is only happening for one file. This is .Net core project with angular frontend.

Related

Angular Build reverse engineering: How to revert minified javascript files to their original typescript form

I have a series of js files. (i.e. 0.js , 1.js, 2.js, 3.js ... 15.js) along with 0.js.map , 1.js.map ... 15.js.map in a folder that also contains main.js and main.js.map and vendor.js along with vendor.js.map.
These are files that contain Phonegap(Cordova) and Ionic code.
The project is probably using Angular for building. Although in the Chrome Dev Tools in the Sources tab I can only see the ng folder. A webpack folder does not seem to be displayed. According to https://angular.io/cli/build :
The application builder uses the webpack build tool, with default configuration options specified in the workspace configuration file (angular.json) or with a named alternative configuration.
Is there a way to convert the files in their original Typescript format using the source map files (.js.map) in order to alter them?

Convert a JavaScript file back to it's TypeScript code using it's declaration and sourcemap file

I had a file, module.ts written in TypeScript and compiled it to JavaScript for production deployment. What was I left with were the following files;
module.js (the TypeScript code compiled into JavaScript)
module.d.ts (the declaration file)
module.js.map (the source file)
Now I want to revert the module.js back to module.ts file using all these 3 files because I don't have that .ts file anymore.
I tried loading module.js inside the browser, hoping it should load it's .ts file into the Developer Tools, using the Sourcemap, but it doesn't. I believe I am missing the point here of having a Sourcemap after all.

Minified file does not use minified module

I have a node.js folder which contains a main js file and several other js files which contain the functions that the main js file will import.
I have minified all the js files in this folder.
In the original main.js file, it calls another module with the following line;
var func= require('./func');
After minification, this line remains the same. However, func.js is changed to func.min.js after minification. Do I have to modify the minified file manually to have it import func.min.js this way?
var func= require('./func.min');
It is quite tedious to manually make changes to the minified file. What is the most efficient way to minify my js files and get the main.min.js working?
I am using Webstorm file watchers to minify the js files.
To get your main.js working, change the require line in main.js to;
var func= require('./func.min');
This will work because you are using Webstorm file watchers to minify the js files. Therefore, when func.js is changed, func.min.js will be automatically generated.

File location is not found in js file

I develop one js file and also call one js file from it, but I cannot find file. Error is "file not found". I debug in firebug. File url is not generate well. Code is:
require(['modules/PageDecorator'], function(PageDecorator){
//initializing visual ui
PageDecorator.init();
});
it it, modules is folder and PageDecorator is js file.
url is generated
localhost/js/models/PageDecorator.js
however I need it to be:
localhost/test/js/models/PageDecorator.js
test is my root folder.

Bootstrap 3.1.1: I can't import all the bootstrap .js files, how is "= require" supposed to work?

I am using the latest Bootstrap v3.1.1 Sass.
Within the .zip file, I get
lib, tasks, templates, test and vendor.
I ignored everything and only use the vendor > assets folder.
The assets folder has all the fonts, stylesheets and javascripts I need.
I have gotten the file structure setup properly.
However when I am trying to import .js files from the javascript folder, I am having a bit of a problem.
Unlike the bootstrap.scss file that comes along. I can just uncomment the _.scss file that I need and it will work.
Within the bootstrap.js file, it contains some syntax that I haven't seen before. After a bit of Google, it says 'require' is a nodejs syntax.
I uncommented a few and try to see if they work. However it fails. the .js file I got back is exactly like the above screenshot. It doesn't concatenate modal.js, tooltip.js and popover.js. I did abit of Google, it says I need to have RequireJs?

Categories

Resources