Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Transpiling issue #1

@pietrop

Description

@pietrop

First of all thanks for the great component, and blog post, very useful and insightful.

I run into an error when running npm build to transpile the component in the dist folder.
Turns out the preset for babel, babel-preset-react-app was missing in the dev dependencies.

This can be installed as

npm install babel-preset-react-app  --save-dev

So perhaps your create-component-lib script could be updated on line 34 to include that too.


The nice thing about installing react-scripts in the bash script is that this seemed to work for setting up the latest create-react-app v2 which supports css modules, so that's cool.

However thought I'd mentioned I ended up installing the official babel react presets,@babel/preset-react and @babel/core @babel/cli

So thought I'd mentioned it in case you want to add those to the script instead of the unofficial once.

For convenience, updated line in the script would look like this

npm i react react-dom react-scripts  @babel/core @babel/cli @babel/preset-react rimraf --save-dev

Hope this helps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions