Skip to content

Let's talk about dead code elimination #314

@andys8

Description

@andys8

Since dead code elimination is one of the core features of elm 0.19.

Create Elm App comes with an opinionated setup for dead code elimination which is disabled by default, because it may break your code.

Does it make sense to disable dead-code elimination by default?

I guess DEAD_CODE_ELIMINATION is about the uglify settings, but elm-webpack-loader would still set the --optimize flag.
Since the elm documentation itself describes how to run uglify, it should be pretty safe to enable the settings by default.

An alternative approach would integrate elm-minify which is implementing a webpack plugin. It's about adding a dependency, but maintaining less directly (in cases this will be improved in the future). In any way the implementation is interesting, since there are differences in the settings.
https://github.com/opvasger/elm-minify/blob/master/src/api.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions