You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My entry point is inside the directory that has been copied. This plugin seems to use the webpack file emit at the end to output the files. Is there a way to do this sooner? Or to somehow target an entrypoint inside the copied directory?
But you could hook into the compilation process before entrypoints are resolved. I ended up doing it like this:
constEventHooksPlugin=require('event-hooks-webpack-plugin');constfs=require('fs-extra')//in webpack pluginsnewEventHooksPlugin({'before-run': (compilation,done)=>{console.log('Copying source files to compiled')fs.copy('src','compiled',done);}}),
leibrug, stereokai, appsparkler, vlad-saritasa, nils-tekampe and 10 moreappsparkler, lorenz068 and Okeanosappsparkler, lorenz068, vasiliy0s, sa-yamingo, gopal-int and 3 more
changed the title [-]Is there a way to make the copy happen before webpack loads the entry points?[/-][+][Feature] allow copy files before and after webpack build[/+]on Feb 18, 2019
Activity
michael-ciniawsky commentedon Dec 18, 2017
Sry, this plugin is an integration of
cp
for webpack during runs, there is no way to start/use awebpack
plugin without actually startingwebpack
factoidforrest commentedon Dec 18, 2017
But you could hook into the compilation process before entrypoints are resolved. I ended up doing it like this:
michael-ciniawsky commentedon Dec 18, 2017
Sry, I overread
entrypoints
:), (maybe) possible, but not supported atmstereokai commentedon Mar 22, 2018
@light24bulbs Thank you, your comment helped out a lot!
[-]Is there a way to make the copy happen before webpack loads the entry points?[/-][+][Feature] allow copy files before and after webpack build[/+]appsparkler commentedon Mar 26, 2019
@evilebottnawi
It would be nice to have an
option
likeevent
(either inoptions
orpattern config
) which will decide when thecopy
is executed.alexander-akait commentedon Mar 26, 2019
PR welcome
rburnham52 commentedon May 3, 2019
Qvatra commentedon Jun 28, 2021
possible workaround is to use WebpackShellPlugin
https://stackoverflow.com/questions/36773619/webpack-execute-function-before-build-starts