Skip to content
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

Package does not get transpiled when used with webpack/babel #21

Open
jnachtigall opened this issue May 29, 2020 · 4 comments
Open

Package does not get transpiled when used with webpack/babel #21

jnachtigall opened this issue May 29, 2020 · 4 comments

Comments

@jnachtigall
Copy link

I am using this as dependency/part of https://github.com/rjsf-team/react-jsonschema-form/ and arrow functions and ... rest operator where not transpiled, that is, the app was not running in IE11.

I guess when publishing to npm the package should be transpiled.

I fixed locally with having this workaround in my webpack.config.js, that is, adding the package to be resolved locally:

        {
          test: /\.(js|jsx)$/,
          include: [
            path.resolve("src"),
            path.resolve("./node_modules/json-schema-compare"),
            path.resolve("./node_modules/json-schema-merge-allof")
          ],
          loader: "babel-loader",
        },
@jnachtigall
Copy link
Author

See also https://www.robinwieruch.de/publish-npm-package-node for a tutorial for this

@jnachtigall
Copy link
Author

I know I should send a PR but no time :) just for the record, this is a problem easy to hit with setups like Create-React-App, see facebook/create-react-app#6195 (comment)

@snuzi
Copy link

snuzi commented Mar 31, 2021

@jnachtigall your workaround seems interesting. I tried it but I get

Uncaught Error: Cannot find module 'core-js/modules/es.symbol.js'
    at webpackMissingModule (index.js:1)
    at eval (index.js:1)
    at Object.../node_modules/json-schema-merge-allof/src/index.j

Do you have any idea about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants