When I serve my ionic app, it creates a .sourcemaps folder in the project root.
Ionic shouldn't pollute my project root with sourcemaps or any generated files.
Steps to reproduce:
ionic start testApp blankcd testAppnpm run ionic:servels .sourcemaps (contains main.css.map and main.js.map)Which @ionic/app-scripts version are you using?
2.1.4
@jgw96 @mlynch same for me and 16 other people.
I'm using the following version of ionic-app-scripts: 3.0.1
I don鈥檛 see a better place for them. Now you have prod sourcemaps instead of us deleting them. There鈥檚 a flag to disable it (can dig up later)
Add .sourcemaps to your .gitignore to avoid checking them in. We recently added this to the app base.
Open to other ideas on location (can鈥檛 put them in www because that would put them in your actual app)
How about /tmp or $TMPDIR on macOS, both should get cleaned up by the system (see https://apple.stackexchange.com/a/22716/229133).
On Windows, I think the equivalent would be %TEMP% or Path.GetTempPath() (https://msdn.microsoft.com/en-us/library/system.io.path.gettemppath.aspx), which would usually be something like C:\Users\UserName\AppData\Local\Temp\.
For /tmp on Linux see http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s18.html, or /var/tmp (http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html).
Operating systems provide temporary folders exactly for cases like this. Please re-open this as it is not solved, and thanks for looking into it 馃
Edit: Node has a function to get the temp dir cross-platform in the OS module:
https://nodejs.org/api/os.html#os_os_tmpdir.
I'm unsure if people want the sourcemaps to optionally commit them to source code management. They are useful in many cases. We're using them for Ionic Pro monitoring, for example.
Then how about making an option sourcemapsDir in ionic-config.json in case people want it (I guess many only need them temporarily for debugging)?
Yeah, would love for this to be a configurable option inside package.json "configs" section.
@mlynch do you want to reopen this?
Most helpful comment
I'm unsure if people want the sourcemaps to optionally commit them to source code management. They are useful in many cases. We're using them for Ionic Pro monitoring, for example.