pugjs / babel-plugin-transform-react-pug

A plugin for transpiling pug templates to jsx
MIT License
811 stars 47 forks source link

Babel 7 #30

Closed stevenxxiu closed 5 years ago

stevenxxiu commented 6 years ago

Babel 7 uses require('@babel/core'); now, substituting that in the source appears to work.

A temporary fix now is to install babel-core^7.0.0-bridge.0.

ForbesLindesay commented 6 years ago

If the babel team publish a guide for plugin authors to migrate, we can add support for babel 7. Failing that, once babel 7 is fully released, we could upgrade this library to babel 7 as a breaking change. At the moment, we still need to support babel 6.

ezhlobo commented 6 years ago

I've not met any issue with babel 7 on my projects. In case you have something which blocks you, share with us please.

jasperandrew commented 6 years ago

I'm getting this message:

    { Error: Cannot find module 'babel-core'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/mnt/c/Users/Jasper/Github/billy/node_modules/babel-plugin-transform-react-pug/lib/utils/parse.js:8:18)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3) code: 'MODULE_NOT_FOUND' }

It looks to me like this is an issue with the new naming conventions of Babel 7, as stated above. Probably changing babel-core to @babel/core would fix it.

ezhlobo commented 5 years ago

@shirohana @stevenxxiu @jasperandrew we now officially support babel@7 starting from 7.0.0 version of this plugin.