gajus / gajus/write-file-webpack-plugin

No file is saved

Open
#29 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
520
Forks
53
PR merge metrics
No merged PRs in 30d

Description

I don't get it how it's supposed to work.

I'v added write-file-webpack-plugin to my `webpack.config.js`:

`var WriteFilePlugin = require('write-file-webpack-plugin');`

and included it in plugins:

```
plugins: [
new WriteFilePlugin({force: true}),
new webpack.HotModuleReplacementPlugin(),
],
```

Also, I've set devServer's outputPath to be the same as output.path as you recommended:

```
config.devServer = {
host: 'localhost',
//hot: true, // adding back will break webpack-dev-server!
//port: 8080,
port: 8080,
inline: true,
stats: '_errors-only',
contentBase: './',
outputPath: './app/dist/js/' // needed?
};

config.output = {
path: './app/dist/js/' // needed?
};
```

For the sake of test, I've deleted my previously generated bundle.js and run webpack-dev-server. Output:

```
C:\sites\YDR\branches\refactoring\development>webpack-dev-server
[11:27:38] [write-file-webpack-plugin] options { exitOnErrors: true,
force: true,
log: true,
test: null,
useHashIndex: true }
http://localhost:8080/
webpack result is served from /
content is served from ./
(... typical dev-server output ...)
```

But no bundle.js is created anywhere.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.