Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Latest commit

 

History

History
34 lines (29 loc) · 1.13 KB

old-build-toolchain.md

File metadata and controls

34 lines (29 loc) · 1.13 KB

Using carbon-web-components with old build toolchain

carbon-web-components package ships with code that is optimized for modern browsers.

We have seen that old Webpack, old Babel or UglifyJS2 cannot parse object rest operator in our code unless our code is transpiled with transform-object-rest-spread Babel plugin. Here are some details:

We recommend upgrading build toolchain that will solve the problem. In case you still like to keep using older build toolchain, make sure our code is transpiled with appropriate set of Babel plugins, including transform-object-rest-spread. Here's an example with Webpack2/Babel6:

module: {
  loaders: [
    {
      test: /\.js$/,
      include: [
        path.dirname(require.resolve('carbon-web-components/es')),
      ],
      use: [
        {
          loader: 'babel-loader',
          options: {
            babelrc: false,
            plugins: ['transform-object-rest-spread']
          }
        }
      ]
    },
    ...
  ]
}