webpack doesn't run on Windows
Seems like the current implementation of webpack/lib/MemoryOutputFileSystem.js doesn't run on windows machines. It utilizes unix-style separators.
I've replaced all occurences with path.sep and uncommented the checks like this:
path = path.split(pathUtil.sep);
//if(path[0] != "") return callback(new Error("Invalid path " + path.join("/")));
and now it's running.
How do you use it?
It works in memory and doesn't use system-dependend filenames (it doesn't access the disk). Use unix-like filenames.
If you use it with webpack-dev-middleware specify output.path = "/".
I'm using webpack in conjunction with the webpack-dev-middleware. This is my current webpack configuration:
{
alamidConfig: null,
context: null,
entry: "./app/init.client.js",
output: {
path: "assets",
publicPath: "/assets/",
filename: "app.[hash].js"
},
cache: true,
amd: { jQuery: true },
optimize: {
minChunkSize: 10000,
maxChunks: 20
},
debug: false,
devtool: "eval",
minimize : true,
module: {
loaders: [
{ test: /\.html$/i, loader: "raw-loader" }
]
},
resolve: {
root: process.env.NODE_PATH
},
plugins: [
new AlamidWebpackPlugin()
]
}
context and output.path are set on runtime depending on the alamid config. I tried a console.log to ensure that the paths are right:
context: C:\Users\jhnns\dev\peerigon
output.path: C:\Users\jhnns\dev\peerigon\bundle\assets
These paths do exist of course :wink:. The AlamidWebpackPlugin works as you suggested in #79. I've added console.logs to ensure that the plugin is not messing with the paths (especially replacing backslashes). And it seems like the plugin is working right.
Then I've added a console.log(path); on line 22 of MemoryOutputFileSystem.js and it prints:
C:\Users\jhnns\dev\peerigon\bundle\assets
After that it fails (of course).
hmm... It's too complex to explain people why \ doesn't work with webpack-dev-middleware... So I'll add support for windows-like paths to the MemoryOutputFileSystem and MemoryInputFileSystem...
as workaround you just can set output.path to "/" (path is just in memory so it's irrelevant, but must be unix-like)
You could also override output.path within the webpack-dev-middleware (as it is irrelevant).
@jhnns overwriting of output.path would work currently, but supporting windows paths in the memory fs seem to be the cleaner solution.
K thx. :smile:
ridiculous. tried to use it. not working with windows? lol. hopefully this framework will be not succesful.
@chrisiDC webpack is working on Windows. Check your configuration and stop flaming.
with 20 years of experience i must be a complete fool not to be able to set it up within 4 hours.. have to quit my job. but sorry if i flame u. anyways, i dont think it works in windows out of the box... cheers
I'm sorry. I used to have a Windows machine and I had no problems. Even @sokra, the owner of the project, has a Windows machine, so I bet webpack runs on Windows. Without any error or hint, we can't help you.
i will provide an error hint asap. currently i am in the office :) thx for your feedback