brettsmason/luxe

clean-webpack-plugin config error

tiborp opened this issue · 8 comments

Hi Brett,

When running npm run dev on a fresh install, I get the following error:

Error: clean-webpack-plugin only accepts an options object

The issue seems to be the path.resolve part, on line 99 in webpack-common.js:

new CleanWebpackPlugin(path.resolve(__dirname, config.paths.public), { verbose: false }),

Would you have any idea on how to fix this? (my webpack knowledge is very limited..)

Thanks in advance!

Sorry this is my fault!
I updated the plugin quickly and didn't have time to test it. I'll push up a fix for it, but basically the new version had a slightly different syntax.

Also if you have any feedback on the theme in general, problems etc let me know as I'm planning a bit of a rewrite 🙂

OK cool. Thx!

I'm just starting on a new project, so I'll let you know if I have suggestions for stuff to add or improve; so far I am already liking it a lot as it is now :-)

I also noticed #100: I was looking at Tailwind too, and found it quite inspiring to see what it does with utility classes.

@tiborp Feel free to give it a try now. The latest commit shows what to change if you want to just update your current project. Let me know how you get on 😄

Thx Brett! I solved it the same way but wasn't sure if it would break things when just leaving the path out.

I'm not sure if this is related, but it seems that when working in dev mode(npm run watch) the /public directory is emptied on save, which then gives an error for svg's that are being referenced from there in Svg.php on line 139

Ah yes, I found this issue before too with the clean plugin upgrade.
I'm about to go on holiday for a week so I dont have time to look atm, but I think theres a setting in clean webpack plugin along with copy webpack plugin.

The easiest solution for now would be to lock clean webpack plugin to v1 though and use the old setup - it works fine.

I'll revisit the build process when I get back though - I've been meaning to anyway.

Thx. I had a look at the settings and found that using cleanStaleWebpackAssets: false, helps preventing the error, but again, I'm not sure if it is the right solution, as in: if this will cause different problems in the build proces :-) Anyway...Enjoy your holiday!

I finally got round to testing the build process again!
I have updated everything and everything works fine other than the issue described here: webpack-contrib/copy-webpack-plugin#385

Looks like this will require an upstream fix so I'll keep this open for now.