survivejs / webpack-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/webpack/
2.42k stars 319 forks source link

CleanWebpackPlugin using * #95

Closed richpixel closed 8 years ago

richpixel commented 8 years ago

I tried the idea of using the following:

If you want to preserve possible dotfiles within your build directory, you can use path.join( PATHS.build, '*') instead of PATHS.build.

But it doesn't delete any files in the build dir. I'm on Mac OS. The output message is:

clean-webpack-plugin: /MyFolder/[lab]/webpack-demo/build/* has been removed.

bebraw commented 8 years ago

Hi,

I tried parts.clean(path.join(PATHS.build, '*')), at webpack-demo. After the initial build, I placed foobar and .foobar files to the build directory. If I rebuild the project this, only .foobar remains.

Can you set up a standalone test case? Maybe I'm missing something obvious here.

Mac OS here too btw.

richpixel commented 8 years ago

Thanks... it looks like the problem is because I have square-brackets in my path:

/Work/[lab]/webpack-demo

So a simple rm -rf /Work/[lab]/webpack-demo/build/* on the command line does nothing... but this is all a pretty minor non-issue. Thanks for taking a look!