Giter Site home page Giter Site logo

Comments (4)

SampsonCrowley avatar SampsonCrowley commented on May 25, 2024

this is not an issue in dev mode and i added require('babel-core/register')({ presets: ['latest'] }) to the top of server-prod.js

from ghadyani-framework-old.

Sawtaytoes avatar Sawtaytoes commented on May 25, 2024

Hmm... That's strange. So you're saying if you add decorators to .babelrc, it doesn't work properly for production builds, but it works for development.

You'll need to modify this to work with decorators: require('babel-core/register')({ presets: ['latest'] })

Like so:

require('babel-core/register')({
    plugins: ['transform-decorators-legacy'],
    presets: ['latest'],
}) 

Normally .babelrc is used, but here, it's been customized because .babelrc in this project is designed for client-side only. An even better fix is to make a server-side .babelrc-server that gets required in for this config so it can be shared in both server-dev and server-prod.

from ghadyani-framework-old.

SampsonCrowley avatar SampsonCrowley commented on May 25, 2024

where is babelrc currently being imported for client side?

the part I don't understand is how it is working in dev mode. I don't see anything that would make babel use the babelrc in dev but not in production

the file this is crashing on is a client file btw

from ghadyani-framework-old.

SampsonCrowley avatar SampsonCrowley commented on May 25, 2024

fixed by adding: 'babel-loader?plugins[]=transform-decorators-legacy,presets[]=latest,presets[]=stage-0,presets[]=react' to webpack.config.server.prod.js

from ghadyani-framework-old.

Related Issues (4)

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.