create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Compilation not working after ejecting

Open maximebj opened this issue 5 years ago • 2 comments

Hi!

I've tried to eject CGB because I need to change webpack configuration (to watch another JS file)

But just after ejecting, and launching compilation, it seems like the compiler doesn't like my JS (it worked fine prior ejection):

capture 2019-01-27 a 11 59 26

Anybody has an idea?

It seems like babel or something like this doesn't do its job well.

maximebj avatar Jan 27 '19 14:01 maximebj

Ok found it !

When ejecting, a plugin is missing in package.json. By Adding "transform-class-properties", it works again:

"plugins": [
      [
            "transform-object-rest-spread"
      ],
      [
    	    "transform-class-properties"  // I was missing!
       ],
       [
        "transform-object-rest-spread",
          {
            "useBuiltIns": true
          }
      ],
      [
        "transform-react-jsx",
        {
          "pragma": "wp.element.createElement"
        }
      ],
...

Also, do we need 2 times transform-object-rest-spread?

maximebj avatar Jan 28 '19 18:01 maximebj

I have no "plugins" section in my package.json file. Is that specific to your project? I also ejected and now my CSS doesn't compile anymore.

audiocommander avatar Mar 27 '19 13:03 audiocommander