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

webpacker:compile doesnt seem to be loading babelrc #1336

Closed
roine opened this Issue Mar 11, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@roine

roine commented Mar 11, 2018

Im trying to get my js to compile to valid JS for IE10. Also the debug mode doesnt seem to run in prod compile mode, everything is fine in webpack-dev-server. Here's my config:

  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": ["IE 10",
          "> 1%",
          "last 2 versions"
        ],
      },
      "useBuiltIns": true,
      "debug": true,
    }]
  ],

  "plugins": [
    "syntax-dynamic-import",
    "transform-object-rest-spread",
    ["transform-class-properties", { "spec": true }]
  ]
}

Here is where it breaks r=n[i]={i,, IE10 doesnt support this syntax.

Following screenshots are from the same page

Dev mode
screen shot 2018-03-11 at 1 56 48 pm

After compile, running in Prod mode
screen shot 2018-03-11 at 2 03 43 pm

How do I get my prod build to work for IE10?

@roine

This comment has been minimized.

roine commented Mar 11, 2018

Solved with:

const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
environment.plugins.delete('UglifyJs');
environment.plugins.set('UglifyJs', new UglifyJSPlugin({
  uglifyOptions:{
    ecma:5
  }
}));

@roine roine closed this Mar 11, 2018

@dipakchandranp

This comment has been minimized.

dipakchandranp commented Aug 7, 2018

@roine Where did you add this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment