antonybudianto / angular-starter

:star: Gulp Angular Starter using TypeScript (Updated to 4.4.3)

Home Page:https://antonybudianto.github.io/angular-starter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Source maps in production build

l0stpenguin opened this issue · comments

Is it possible to have external source maps in the production build? I enabled the source map option in the system builder config:

var systemJs = {
        builder: {
            normalize: true,
            minify: true,
            mangle: true,
            runtime: false,
            sourceMaps: true,
            globalDefs: {
                DEBUG: false,
                ENV: 'production'
            }
        }
    }; 

I can see the maps being generated but they are not being copied the build folder. I copied the bundle.js.map to the build folder manually, Chrome says source map available, but they are not displayed correctly. They instead show index.html code as shown in the screenshot below.

screen shot 2016-09-11 at 7 28 40 pm

Is there something i am missing? By the way, i see lib.js also being generated, what does it contain and how is it created?

lib.js is for global js packages, you can see them in index.html and it's generated using gulp-useref

for sourcemap, you can take a look at https://github.com/antonybudianto/angular2-starter/blob/master/config/gulp/tasks/typescript.js#L91
I don't know if sourcemap will work after being bundled since the original source file is in JS format (the sourcemap may point to the transpiled js instead of the original TS one)