Issue 1:
Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

When webpack config context is of the form C:/Users/myUserName/Documents/myproject/ it is rejected by validation as being not absolute.

If the current behavior is a bug, please provide the steps to reproduce.

In the node REPL, after npm install webpack@2:

> require('webpack')({
context: 'C:/Users/cspotcode/Documents/dev/myproject',
entry: 'a'
});
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.context: The provided value "C:/Users/cspotcode/Documents/dev/myproject" is not an absolute path!
at webpack (C:\Users\<... truncated by me>

What is the expected behavior?

The validation should recognize that path as a valid, absolute path on Windows. / and \ are both valid path separators on Windows. Node's path.isAbsolute() indicates that the path is absolute.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.

webpack v2.7.0

Windows 10

node v9.2.0

EDIT: related to, but not a duplicate of, #4530 and #4533

Issue 2:
I'm working on universal starter for angular2. It should prerender the application on a server and execute it in a web worker on a client. So I have three environments (targets):

browser main thread

web worker

server

There are several chunks that can be shared between these three environments (in parentheses I pointed on the environments where the chunk should be executed):

vendors (main_thread, web_worker, server)

app (server, web_worker)

server (server)

browser (main_thread)

worker (web_worker)

I don't want a web worker to load its own vendors chunk, which differs from the main thread vendors chunk only in a name of a callback (webpackChunk(cunkIds, cb) vs webpackJsonp(chunkIds, cb)). A vendors chunk can be huge, no need for extra traffic. Also there is no need to compile the same chunks (app and vendors) several times for different targets (and I would like to have only one config after all). So I want something like this:

const TargetPlugin = webpack.optimize.TargetPlugin;
const CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;

module.exports = {
entry: {
vendors: 'vendors.js',
app: 'app.js',
server: 'server.js',
browser: 'browser.js',
worker: 'worker.js'
},
output: { /* ... */ },
plugins: [
// remove duplicate "app"" code from 'server', 'browser' and 'worker',
new CommonsChunkPlugin({ name: 'app', chunks: ['server', 'browser', 'worker'], minChunks: Infinity }),
// remove duplicate "vendor" code from 'server', 'browser' and 'worker',
new CommonsChunkPlugin({ name: 'vendor', chunks: ['server', 'browser', 'worker'], minChunks: Infinity }),
// Initial chunk for server
new TargetPlugin({ name: 'boot_server', chunk: 'server', target: 'node'}),
// Initial chunk for browser's main thread
new TargetPlugin({ name: 'boot_browser', chunk: 'browser', target: 'web' }),
// Initial chunk for web worker
new TargetPlugin({ name: 'boot_worker', chunk: 'client', target: 'webworker' }),
],
};

Because of the TargetPlugin the app, vendor, server, browser and worker chunks are not initial chunks anymore. They are normal chunks and can be used with any of boot_* chunks (which are initial now). Could you tell me can something like this be implemented?