sonatype-nexus-community / copy-modules-webpack-plugin

A Webpack plugin which copies module sources to a separate directory
Apache License 2.0
18 stars 7 forks source link

module.fileDependencies is undefined #1

Closed Daniel-m-github closed 6 years ago

Daniel-m-github commented 6 years ago
rpokorny commented 6 years ago

Hi @Crazedyeti , thanks for the bug report. Are you able to discern if there is anything special about the modules that do not have the fileDependencies property? For instance, we noticed while developing this plugin that external modules do not have that property, so we check for that. Before deciding to just ignore modules that don't have fileDependencies, I'd want to know what kind of modules they are and to hopefully figure out why they don't have fileDependencies.

Daniel-m-github commented 6 years ago

@rpokorny Sure thing. I went back and put a console.log to see what the module objects errors on for me look like. What I found out is the two module types it is erroring on look like this:

DependenciesBlock { dependencies: [ SingleEntryDependency { etc...

and the other

DependenciesBlock { dependencies: [ ContextElementDepedency { etc...

this second type I've also noticed is my own projects files. As far as I can tell this is the only thing that stands out as different

rpokorny commented 6 years ago

OK, looking at webpack's types a little more it seems like there are a lot of things that might not have a fileDependencies property - basically everything that isn't a NormalModule. Please try version 1.0.2 of this plugin which I've just released with a fix for this.

Daniel-m-github commented 6 years ago

Got a chance to try out the new change. Worked like a charm! Thanks a bunch for creating this plug-in. I am already finding it to be very useful.