jonespen / kss-webpack-plugin

Generate KSS styleguide from Webpack
MIT License
10 stars 10 forks source link

Improve Webpack 4 compatibility #9

Closed damorej-at-theinstitutes closed 5 years ago

damorej-at-theinstitutes commented 5 years ago

Improves compatibility for Webpack 4 and eliminates the Tapable warning mentioned in Issue #7. Followed the example provided by davecranwell-adestra. Very open to feedback!

damorej-at-theinstitutes commented 5 years ago

@ryuran I haven't, no -- I wasn't even aware that Webpack 5 is available, but I see now that 5.0.0-alpha.14 was released earlier today. I'll take a closer look at that soon (hopefully tonight, but definitely sometime this week) and will update this request. Thank you!

damorej-at-theinstitutes commented 5 years ago

Hi @ryuran, I gave this a shot with webpack 5.0.0-alpha.14 and it appears to work just fine. I hesitate to include version 5 in the package.json peerDependencies because I'm not sure if webpack 5's API is stable, but I'd be open to including it if anybody disagrees.

ryuran commented 5 years ago

@jonespen It can be merged ?

jonespen commented 5 years ago

Sure. Is it a breaking change?

damorej-at-theinstitutes commented 5 years ago

@jonespen Nope! It should continue working the same way using the older API for Webpack 3 users, but will use the newer API for Webpack 4 and 5 users. I primarily tested with the latest version of Webpack 4, but also checked Webpack 3.12.0 and Webpack 5.0.0-alpha.14 and it seems to work well for all three major versions.

jonespen commented 5 years ago

v1.4.0: https://github.com/jonespen/kss-webpack-plugin/commit/524e5f7f421eaf3ba22a9bf8f5cf90e5c2865792

Thanks!

If anyone want to become a collaborator, just holla. I don't use this anymore, so I'm kinda out of the loop here.

ryuran commented 5 years ago

@jonespen I’m in !

ryuran commented 5 years ago

@damorej-at-theinstitutes

TypeError: this.render is not a function
    at kssRender (…/node_modules/kss-webpack-plugin/index.js:24:10)
    at _err6 (eval at create (…/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:48:1)
    at Promise.resolve.then.then.then.then.then.then.then.then.catch.then.then.then (…/node_modules/html-webpack-plugin/index.js:224:11)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
damorej-at-theinstitutes commented 5 years ago

@ryuran Odd! That isn't one of the lines I'd changed -- Can I ask what version of Webpack you're using?

ryuran commented 5 years ago

@damorej-at-theinstitutes
webpack --version v4.34.0 kss --version : 3.0.0-beta.25

damorej-at-theinstitutes commented 5 years ago

Thank you! I'll be taking a look at this shortly.

damorej-at-theinstitutes commented 5 years ago

@ryuran I'm not able to reproduce this using Webpack 4.34.0 using the small test project I've been using. Later today I'm going to publish the test project I've been using and maybe we can work together to figure out why it's working fine for me but not for you and potentially others.

damorej-at-theinstitutes commented 5 years ago

@jonespen If it wouldn't be too much trouble to add me as a collaborator, I'd appreciate it! Thank you!

jonespen commented 5 years ago

@ryuran @damorej-at-theinstitutes I sent you invites now. Please don't inject any bitcoin stealing code ;)