WARNING: You are browsing the documentation for Symfony 4.2 which is not maintained anymore. Consider upgrading your projects to Symfony 4.3.

You are browsing the Symfony 4.2 documentation, which changes significantly from Symfony 3.x. If your app doesn't use Symfony 4.2 yet, browse the Symfony 3.4 documentation.

Enabling Source Maps

4.2 version

Enabling Source Maps

Source maps allow browsers to access the original code related to some asset (e.g. the Sass code that was compiled to CSS or the TypeScript code that was compiled to JavaScript). Source maps are useful for debugging purposes but unnecessary when executing the application in production.

Encore's default webpack.config.js file enables sourcemaps in the dev build:

1
2
3
4
5
6
7
8
// webpack.config.js
// ...

Encore
    // ...

    .enableSourceMaps(!Encore.isProduction())
;

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.