antonmedv / monkberry

Monkberry is a JavaScript library for building web user interfaces
https://monkberry.js.org
MIT License
1.49k stars 78 forks source link

Webpack 4 #52

Closed paleo closed 6 years ago

paleo commented 6 years ago

The build with Webpack 4 fails:

ERROR in ./path/to/MyTemplate.monk
Module build failed: TypeError: Cannot read property 'monkberry' of undefined
    at Object.exports.getLoaderConfig (/path/to/myproject/node_modules/monkberry-loader/node_modules/loader-utils/index.js:124:37)
    at Object.module.exports (/path/to/myproject/node_modules/monkberry-loader/src/index.js:6:28)

In package.json, the section dependencies:

"monkberry": "4.0.8",
"monkberry-directives": "4.0.8",
"monkberry-events": "4.0.8",
"monkberry-loader": "4.0.8",
antonmedv commented 6 years ago

I know, I'm working on next version: see next branch.

paleo commented 6 years ago

OK. Can we use the next branch now? Or is it still too unstable?

antonmedv commented 6 years ago

Still in dev. Actually I got monkberry-loader to work correctly with webpack4, try update.

paleo commented 6 years ago

Actually I got monkberry-loader to work correctly with webpack4, try update.

With which version? I have the 4.0.8. I don't see any commit or any npm release related to Webpack 4…

antonmedv commented 6 years ago

Yes, sorry. Fixed only in https://github.com/monkberry/monkberry-loader/releases/tag/3.8.2

paleo commented 6 years ago

Sorry, there is still an error:

ERROR in ./path/to/MyTemplate.monk
Module build failed: TypeError: compiler.addSource is not a function
    at Object.module.exports (/path/to/myproject/node_modules/monkberry-loader/src/index.js:16:12)

With:

"monkberry": "4.0.8",
"monkberry-directives": "4.0.8",
"monkberry-events": "4.0.8",
"monkberry-loader": "3.8.2",
"webpack": "4.1.0",
"webpack-cli": "2.0.10"
antonmedv commented 6 years ago

Yes, "4.0.8" does not supports "3.8.2". There is no fix now. Sorry. But you can port in from "3.8.2".

paleo commented 6 years ago

Ah yes, I understand. But the directives are not available with Monkberry 3.8.2?

antonmedv commented 6 years ago

No.

antonmedv commented 6 years ago

But I think fixing 4.0.8 for work with wp4 is simple.

paleo commented 6 years ago

Here: https://github.com/monkberry/monkberry-loader/pull/2

paleo commented 6 years ago

Could you publish the npm package? It works like a charm on my project (66 templates) with Webpack 3 and 4. NB: I don't use the options globals neither transforms.

antonmedv commented 6 years ago

done

paleo commented 6 years ago

Thank you!