Skip to content

Babel not working for IE11 #670

@eberhapa

Description

@eberhapa

Hi,

Do I have to do something special to make classes work in ie11 because there are still classes in my js build file and therefore my js isn't working in ie11.

class A extends d{constructor(...e) ........

In the package.json I'm targeting:
"browserslist": [ "last 2 versions", "IE 11", "ios >= 8" ],

I'm using "@symfony/webpack-encore": "^0.28.0".

webpack.config.js:

Encore
  .enableSingleRuntimeChunk()

  // the project directory where all compiled assets will be stored
  .setOutputPath('build/')

  // the public path used by the web server to access the previous directory
  .setPublicPath('/wp-content/themes/enfold-child/build')

  .addEntry('main', [
    './src/js/main.js'
  ])
  .addStyleEntry('style', './src/sass/style.scss')
  .addStyleEntry('custom-editor-style', './src/sass/custom-editor-style.scss')

  // allow legacy applications to use $/jQuery as a global variable
  .autoProvidejQuery()

  // allow sass/scss files to be processed
  .enablePostCssLoader()
  .enableSassLoader()

  .copyFiles({
    from: './src/images',
    pattern: /\.(png|jpg|jpeg|svg)$/,
    to: 'images/[path][name].[ext]'
  })

  // enable source maps during development
  .enableSourceMaps(!Encore.isProduction())

  // empty the outputPath dir before each build
  .cleanupOutputBeforeBuild()
;

Thanks in advance,
Patrick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions