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

No file is saved #29

Open
folmert opened this issue Dec 12, 2016 · 2 comments
Open

No file is saved #29

folmert opened this issue Dec 12, 2016 · 2 comments
Labels

Comments

@folmert
Copy link

folmert commented Dec 12, 2016

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.

@gajus gajus added the question label Dec 12, 2016
@adiachenko
Copy link

I suspect it's an issue with resolving path. You bundle may have been created elsewhere. Check every directory up the chain from the path specified including the root of C: drive.

@jereckley
Copy link

I'm having the same issue... My issue is specific in that if I undo a change and save (so I already saved once in that state and undo to return to that state after saving in a different state) webpack is trying to refer me to the previous version that I just removed(because i'm deleting before rewriting). It's crazy... webpack remembers that it just wrote that same file and instead of rewriting just changes itself to refer back to the previous version.

I just question what force is supposed to do? It's defiantly not forcing a new write in that situation.

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

No branches or pull requests

4 participants