Giter Site home page Giter Site logo

Comments (5)

ovidiuch avatar ovidiuch commented on May 18, 2024

@quassnoi Thanks for reporting this.

Previously topLevelAwait had to be enabled manually, which was mentioned in the v6 migration guide. But just pushed a fixed that does it automatically.

Please run npm i -D react-cosmos@next react-cosmos-plugin-webpack@next again and see if this error goes away?

from react-cosmos.

quassnoi avatar quassnoi commented on May 18, 2024

It works now, thanks!

With create-react-app, it's not easy to change the webpack configuration without ejecting or rewiring, so this would definitely be useful for a lot of people.

from react-cosmos.

ovidiuch avatar ovidiuch commented on May 18, 2024

It works now, thanks!

With create-react-app, it's not easy to change the webpack configuration without ejecting or rewiring, so this would definitely be useful for a lot of people.

You're welcome!

Btw you can always override the webpack config as described here: https://github.com/react-cosmos/react-cosmos/tree/main/docs#webpack-config-override.

from react-cosmos.

quassnoi avatar quassnoi commented on May 18, 2024

It works now, thanks!
With create-react-app, it's not easy to change the webpack configuration without ejecting or rewiring, so this would definitely be useful for a lot of people.

You're welcome!

Btw you can always override the webpack config as described here: https://github.com/react-cosmos/react-cosmos/tree/main/docs#webpack-config-override.

I didn't know that!

Can we emit something to this effect in the console log when you run cosmos with webpack?

[Cosmos] Learn how to override webpack config for cosmos: https://github.com/react-cosmos/react-cosmos/tree/main/docs#webpack-config-override

, if you don't have a custom config already?

I can put together a PR if you want.

from react-cosmos.

ovidiuch avatar ovidiuch commented on May 18, 2024

I didn't know that!

Can we emit something to this effect in the console log when you run cosmos with webpack?

[Cosmos] Learn how to override webpack config for cosmos: https://github.com/react-cosmos/react-cosmos/tree/main/docs#webpack-config-override

, if you don't have a custom config already?

I can put together a PR if you want.

Sure, sounds like a good idea.

This is the file you're interested in https://github.com/react-cosmos/react-cosmos/blob/main/packages/react-cosmos-plugin-webpack/src/server/webpackConfig/getUserWebpackConfig.ts.

Just note that this hint might be useful if you have a custom config, too. Like in your case, technically you're passing the CRA webpack config as a custom webpack config, and you might still want to override it.

So with Cosmos you have a base webpack config, which could be the Cosmos-generated default webpack config or a custom config passed via webpack.configPath, and it both cases you can override it via webpack.overridePath.

from react-cosmos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.