Errors from compilation when adding Typescript source map


#1

It seems ionic start didn’t add source mapping to the Typescript project automatically. In the tsconfig file I added: "inlineSourceMap": true. This now provides the correct source maps to be used in the browser console, however, the compilation throws the following error

ERROR in [default] 
Option 'sourceMap' cannot be specified with option 'inlineSourceMap'.

ERROR in [default] 
Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'.

I don’t understand why it’s mentioning the options sourceMap and sourceRoot as these are not in the config.

Any ideas how I can fix this error?


#2

Try this tsconfig.json

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

Also add to following to the webpack.config

  },
  // Source maps support (or 'inline-source-map' also works)
  devtool: 'source-map',

  module: {
    loaders: [
      {
        test: /\.ts$/,
        loader: 'awesome-typescript',
        query: {

#3

Can this not be made the default for the TS starters? Doing this makes debugging much easier in Chrome when using ionic serve.


#4

This is something we’re enabling by default with our new build revamp.
We never really had a concept of testing/production builds, but this is being added.