Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with webpack --watch #31

Closed
johnborges opened this issue Dec 23, 2016 · 5 comments
Closed

Doesn't work with webpack --watch #31

johnborges opened this issue Dec 23, 2016 · 5 comments

Comments

@johnborges
Copy link

johnborges commented Dec 23, 2016

Doesn't seem work with webpack --watch. Build runs, but my shell commands aren't. Has anyone tried this with --watch?

@opiepj
Copy link
Member

opiepj commented Dec 29, 2016

Can you share me your setup?

@zappee
Copy link

zappee commented Jan 9, 2017

Same issue. I cannot use this plugin because it does not work as described and expected.
After start webpack onBuildStart, onBuildEnd and onBuildExit are executed. If I modify any js file then onBuildExit is executed BUT BEFORE (and not AFTER) webpack finished.

My config:

    plugins: [
        new WebpackShellPlugin({
	    onBuildStart: ['echo -e \n--> Webpack is running...'],
	    onBuildExit: ['echo abcccc'],
	    onBuildEnd:['echo -e --> Finished\n\n']
	})
    ]

command:
webpack --progress --colors --bail --watch

Output:

Executing pre-build scripts

--> Webpack is running...
 95% emitExecuting post-build scripts
--> Finished


Executing additional scripts before exit
abcccc
Hash: b4c3e22ed10fdddc9900
Version: webpack 1.14.0
Time: 3445ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.45 MB       0  [emitted]  main
    + 507 hidden modules
 95% emitExecuting additional scripts before exit
abcccc
Hash: 6f718eda48c1715b4760
Version: webpack 1.14.0
Time: 452ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.45 MB       0  [emitted]  main
    + 507 hidden modules



 95% emitExecuting additional scripts before exit
abcccc
Hash: 1f3383c679eddd3c261d
Version: webpack 1.14.0
Time: 436ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.45 MB       0  [emitted]  main
    + 507 hidden modules

@zappee
Copy link

zappee commented Jan 9, 2017

I need to access to the bundle files. I think you need to use after-emit, since emit is triggered when Webpack starts emitting the files.

@zappee
Copy link

zappee commented Jan 9, 2017

Okay, I could see the source code.
This plugin works properly!

If you need to access to the bundle file then you need to use onBuildExit.
You can close this issue.

@opiepj
Copy link
Member

opiepj commented Jan 9, 2017

Keeping this issue open. Need to readvise this pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants