Skip to content

Commit 945ac24

Browse files
committed
Update documentation and testing
1 parent 4006231 commit 945ac24

File tree

5 files changed

+18
-955
lines changed

5 files changed

+18
-955
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
npm-debug.log
33
*.swf
44
.idea/
5+
dist/

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ module.exports = {
2727
}
2828
```
2929

30-
31-
3230
## Example
3331

3432
Insert into your webpack.config.js:
3533

3634
```js
3735
const WebpackShellPlugin = require('webpack-shell-plugin');
36+
const path = require('path');
3837

3938
var plugins = [];
4039

@@ -45,10 +44,14 @@ plugins.push(new WebpackShellPlugin({
4544

4645
var config = {
4746
entry: {
48-
app: __dirname + 'src/app.js'
47+
app: path.resolve(__dirname, 'src/app.js')
4948
},
5049
output: {
51-
path: __dirname + 'dest'
50+
path: path.resolve(__dirname, 'dist'), // regular webpack
51+
filename: 'bundle.js'
52+
},
53+
devServer: {
54+
contentBase: path.resolve(__dirname, 'src') // dev server
5255
},
5356
plugins: plugins,
5457
module: {
@@ -69,7 +72,7 @@ Once the build finishes, a child process is spawned firing both a python and nod
6972
* `onBuildStart`: array of scripts to execute on the initial build. **Default: [ ]**
7073
* `onBuildEnd`: array of scripts to execute after files are emitted at the end of the compilation. **Default: [ ]**
7174
* `onBuildExit`: array of scripts to execute after webpack's process is complete. **Default: [ ]**
72-
* `dev`: switch for development environments. This causes scripts to only execute once. Useful for running HMR on webpack-dev-server. **Default: true**
75+
* `dev`: switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. **Default: true**
7376
* `verbose`: enable for verbose output. **Default: false**
7477

7578
### Developing

lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ var defaultOptions = {
3434
onBuildEnd: [],
3535
onBuildExit: [],
3636
dev: true,
37-
verbose: false
37+
verbose: false,
38+
watch: false
3839
};
3940

4041
function puts(error, stdout, stderr) {
@@ -94,6 +95,10 @@ var WebpackShellPlugin = function () {
9495
});
9596

9697
compiler.plugin('emit', function (compilation, callback) {
98+
for (var key in compilation.options) {
99+
console.log(key);
100+
}
101+
console.log('EMITTING');
97102
if (_this.options.onBuildEnd.length) {
98103
console.log('Executing post-build scripts');
99104
_this.options.onBuildEnd.forEach(function (script) {

0 commit comments

Comments
 (0)