i'm trying to use a third party npm dependency and...
# javascript
j
i'm trying to use a third party npm dependency and when i try to compile a simple wrapper for it i get this error
Module parse failed: Unexpected token (10:29)
  File was processed with these loaders:
   * ../../node_modules/source-map-loader/dist/cjs.js
  You may need an additional loader to handle the result of these loaders.
googling states it might be babel problem so i tried adding it as a loader
config.module.rules.push({
    test: /\.extension$/,
    loader: 'babel-loader'
});
config.module.rules.push({
    test: /\.extension$/,
    loader: 'ts-loader'
});
but still no luck. anyone have any thoughts? (using the multiplatform plugin if that matters)
b
Could you please share more about your case? What is name of library?
Maybe you could share the project?
j
the name of the library is react-data-grid (https://www.npmjs.com/package/react-data-grid)
i can post a sample here in a bit about what i've tried so far
brokenjs.zip
b
@Josh Feinberg checkout fixed version
Since
react-data-grid
uses ES2020 features it’s required to transpile it, take a look
webpack.config.d
dir. Also • I slightly rewrite declaration, see
ReactDataGridModule.kt
• added additional declarations, see
ReactDataGrid.kt
• added a trick to import css
j
ah, amazing!
thanks so much for the help
also was going to eventually ask about the css so glad to see that here too