Copy-webpack-plugin: [Feature] Passing throw loaders

Created on 18 Nov 2016  路  11Comments  路  Source: webpack-contrib/copy-webpack-plugin

Hi,

is it possible for the files to go thru the loaders? This way we can get fingerprinting of files, and etc.

Thanks

5 (nice to have) Needs triage Feature

Most helpful comment

@evilebottnawi html-webpack-plugin does some kind of this. I want to use the same loaders to perform transforming arbitrary files that are not required by js as if they're required. For example I have src/*.md and want them to be transformed into dst/[name].html applying PostHTML plugins, with markdown-it-loader and posthtml-loader, and at the same time I have to require some other .mds that are transformed in the same way. I don't think it's simple that I need another system i.e. the transform option in order to achieve the same task as loaders.

All 11 comments

+1 on this - I have the same question. I'll post if I find a solution

Maybe? This needs some investigation, but for now, you can perform file content modifications using the transform option.

@kevlened how would that work?
For example, i want to compile a less file and then copy it into the build directory. (not using ExtractTextPlugin as I need to keep the files separate from one another and will link them in the html header using react-helmet only after a response from the server)

@zonika i'm searching for the same thing (i think). copy less files but transform them to css while keeping the same structure. have you found a solution?

Still relevant.

This is still needed. Because using a loader doesnt work if you don't require() or import the file anywhere into the app.

Any update on this?

@yuhr can you describe use case for this?

@evilebottnawi html-webpack-plugin does some kind of this. I want to use the same loaders to perform transforming arbitrary files that are not required by js as if they're required. For example I have src/*.md and want them to be transformed into dst/[name].html applying PostHTML plugins, with markdown-it-loader and posthtml-loader, and at the same time I have to require some other .mds that are transformed in the same way. I don't think it's simple that I need another system i.e. the transform option in order to achieve the same task as loaders.

Impossible due design reason, anyway we implement new hook in webpack for copy plugin before minimize step, it is allow to minimize/compress assets and change their in other hooks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jdeniau picture jdeniau  路  5Comments

richmeij picture richmeij  路  5Comments

alex88 picture alex88  路  4Comments

alexprice1 picture alexprice1  路  5Comments

serut picture serut  路  3Comments