aurelia / skeleton-navigation

Starter kits for building a standard navigation-style app with Aurelia.
Creative Commons Zero v1.0 Universal
732 stars 512 forks source link

Typescript-webpack - Visual Code debug #758

Closed zoao closed 6 years ago

zoao commented 7 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: With default webpack.config.ts setting, I Could not debug

Expected/desired behavior: 1- In Visual Code I have installed the extension Debugger for Chrome 2.4.2 2- I create the file launch,json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug in Chrome",
            "type": "chrome",
            "port": 9222,
            "url": "http://localhost:9000/",
            "sourceMaps": true,
            "smartStep":true
        }
    ]
}

3- The execution not stop in breakpoints in Visual Code 4- I did a lot of testing and research and with the following changes in webpack.config.ts it works fine:

output: {
      path: outDir,
      devtoolModuleFilenameTemplate        : '[absolute-resource-path]',
      devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
    },
(....)
  ENV === 'test' || ENV === 'development' ? 
    envDev({devtool: 'inline-source-map'}) :
    envProd({ /* devtool: '...' */ }),

5- The debug in chrome also work good, but when I start debugging in Visual Code, if I try to open the "chrome developer tools", the chrome closes.

In my tests the debug in chrome developer tools is also not working, because this line:

ENV === 'test' || ENV === 'development' ? 
    envDev(**ENV !== 'test' ? {} :** {devtool: 'inline-source-map'}) :
    envProd({ /* devtool: '...' */ }),
cluka commented 7 years ago

I changed this in my webpack.config and now i can debug in chrome. ENV === 'test' || ENV === 'development' ? envDev(ENV === 'test' ? {} : { devtool: 'inline-source-map' }) : envProd({ /* devtool: '...' */ }),

florianwachs commented 7 years ago

Thank you @cluka , because of this change, we can now debug in chrome again. I think it´s a bug in the skeleton template. Changing !== to === corrected our wrong sourcemaps.

Alexander-Taran commented 6 years ago

can be closed