Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated devtool option to a full source-map #1354

Merged
merged 2 commits into from Jan 15, 2018
Merged

Updated devtool option to a full source-map #1354

merged 2 commits into from Jan 15, 2018

Conversation

stephan-v
Copy link
Contributor

@stephan-v stephan-v commented Dec 5, 2017

After reviewing the devtool options from Webpack the cheap-source-map option does not make much sense when wanting to have sourcemaps in production.

Sourcemaps in production are usually used for error reporting tools to unminify code within your error reporting tool. Tools like:

  • Track.js
  • Sentry
  • Rollbar
  • Etc.

The majority of Webpack plugins that provide support for these error reporting services default to source-map as the primary production devtool option. The Webpack documentation also specifies the eval-source-map option as follows:

The following options are not ideal for development nor production.

https://webpack.js.org/configuration/devtool/#special-cases

On the other hand for the source-map option it states:

These options are typically used in production

https://webpack.js.org/configuration/devtool/#production

A full source map provides original code quality which is needed for services like these, to work as efficiently as possible.

https://webpack.js.org/configuration/devtool/#devtool

If there are cases against using a full source-map for the devtool option in production I would love to hear them.

Development sourcemap

I have also updated the development default. inline-source-map is also specified under special cases whereas eval-source-map is specified for development. It has a slower initial build but faster rebuilds and also has original build quality for the mapping.

It yields the best quality SourceMaps for development.

After reviewing the devtool options from Webpack the `cheap-source-map` option does not make much sense when wanting to have sourcemaps in production.

Sourcemaps in production are usually used for error reporting tools to unminify code within your error reporting tool. Tools like:

- Track.js
- Sentry
- Rollbar
- Etc.

The majority of Webpack plugins that provide support for these error reporting services default to `source-map` as the primary production devtool option. The Webpack documentation also specifies the `eval-source-map` option as follows:

> The following options are not ideal for development nor production.

https://webpack.js.org/configuration/devtool/#special-cases

On the other hand for the `source-map` option it states:

> These options are typically used in production

https://webpack.js.org/configuration/devtool/#production

A full source map provides `original code` quality which is needed for services like these, to work as efficiently as possible.

https://webpack.js.org/configuration/devtool/#devtool

If there are cases against using a full `source-map` for the devtool option in production I would love to hear them.
@stephan-v stephan-v changed the title Updated devtool option to a fully source-map Updated devtool option to a full source-map Dec 5, 2017
@JeffreyWay JeffreyWay merged commit a33885d into laravel-mix:master Jan 15, 2018
@JeffreyWay
Copy link
Collaborator

Thanks, @stephan-v!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants