I find app.bundle.js... annoying


#1

Hey there,

First of all, thank you for your great work, I don’t have words for this.

Next, I want to ask a simple question/emit a request: “is there/wouldn’t in be wonderful if there was” a way to use the new ionic serve without compiling the code into a single app.bundle.js? As I am used to the debuging console, it makes my debug habits (navingating into the project files, placing brakpoints, watching vars and stuff) really annoying as you really can’t make any simple connection between the console and your code.

If the question came to be arrisen, I migrated to TypeScript for my new project in opposition du my old JavaScript Ionic projects.

I thank you a lot for the quickness of your answer.
Regards,

Timothée MULLER


#2

Do you have sourceMap set to true in tsconfig.json?


#3

Well,

I have to admit that I didn’t (those TypeScript newbies, I swear) but as far as I can see, it didn’t change a thing to the way my project is displayed in the Google Chrome’s console. :confused:

Do you have any suggestions ? For the record, my tsconfig.json currently looks like this:

{
“compilerOptions”: {
“target”: “es5”,
“module”: “commonjs”,
“emitDecoratorMetadata”: true,
“experimentalDecorators”: true,
“sourceMap”: true
},
“filesGlob”: [
"/*.ts",
"!node_modules/
/*"
],
“exclude”: [
“node_modules”,
“typings/main”,
“typings/main.d.ts”
],
“compileOnSave”: false,
“atom”: {
“rewriteTsconfig”: false
}
}


#4

@Poketchu

i never used the ionic build process, yet. But i have a little question:
Does the compiler remove also console-statements?


#5

Oh erm, maybe I didn’t expressed myslef correctly (french folk, ya know).

The command I’m using isn’t ionic build but ionic serve. But no, it does show me compiling console logs (if that’s what you’re asking - nice and visible red warnings).


#6

yeah, okay that is really annoying. You expressed your problem right, but for me a “build process” is minifying, packaging of the source code - not building the final apps (apk, ipa, …) :slight_smile:


#7

So we are on the same wave: building process occurs in case of ionic serve.

So my question is: is there a way to build during serve to display the code in the browser console (Chrome) as shown in our favorite IDE (bless you sublime text) ?


#8

If you have sourceMap set to true in tsconfig.json, and devtool: 'source-map' in webpack.config.js, I think you should have everything you need for the Chrome developer tools to be able to suss out the original TypeScript sources from the bundle.


#9

Yay!

Just worked like a charm! Well thank you. :slight_smile:
One little more question: will I have to remove those lines if I want the app to be bundeled back again when I’ll use ionic build?