{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/1563","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/1563/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/1563/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/1563/events","html_url":"https://github.com/webpack/webpack/issues/1563","id":113904997,"number":1563,"title":"[Plugins] Wrong path in compiler.options","user":{"login":"frantic","id":192222,"avatar_url":"https://avatars.githubusercontent.com/u/192222?v=3","gravatar_id":"","url":"https://api.github.com/users/frantic","html_url":"https://github.com/frantic","followers_url":"https://api.github.com/users/frantic/followers","following_url":"https://api.github.com/users/frantic/following{/other_user}","gists_url":"https://api.github.com/users/frantic/gists{/gist_id}","starred_url":"https://api.github.com/users/frantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frantic/subscriptions","organizations_url":"https://api.github.com/users/frantic/orgs","repos_url":"https://api.github.com/users/frantic/repos","events_url":"https://api.github.com/users/frantic/events{/privacy}","received_events_url":"https://api.github.com/users/frantic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/webpack/labels/documentation","name":"documentation","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-10-28T19:34:05Z","updated_at":"2016-09-07T12:21:03Z","closed_at":null,"body":"x-post from https://github.com/gajus/write-file-webpack-plugin/issues/1:\r\n\r\nSeems like for some reason [this plugin](https://github.com/gajus/write-file-webpack-plugin/) gets a wrong path in `compiler.options`. In the following case instead of `./dist` I just get `/`. It seems to just use webpack's API so I suspect it's webpack issue.\r\n\r\nMy config:\r\n\r\n```javascript\r\nvar WriteFilePlugin = require('write-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n  entry: \"./src/main.js\",\r\n  output: {\r\n    path: __dirname + \"/dist\",\r\n    filename: \"bundle.js\",\r\n    publicPath: \"/dist\"\r\n  },\r\n  module: {\r\n    loaders: [{\r\n      test: /\\.js$/,\r\n      exclude: /(node_modules|examples)/,\r\n      loader: 'babel-loader?stage=0'\r\n    }]\r\n  },\r\n  plugins: [\r\n    new WriteFilePlugin()\r\n  ]\r\n};\r\n```\r\n\r\nbut the plugin creates a file in my root - `/bundle.js`. I've added some logging. The config exported from `webpack.config.js` looks like this:\r\n\r\n```\r\n{ entry: './src/main.js',\r\n  output:\r\n   { path: '/Users/frantic/code/flexbox/dist',\r\n     filename: 'bundle.js',\r\n     publicPath: '/dist' },\r\n  module: { loaders: [ [Object] ] },\r\n  plugins: [ { apply: [Function: apply] } ] }\r\n```\r\n\r\nhowever inside plugin's `apply` when I `console.log(compiler.options);` I get:\r\n\r\n```\r\n{ entry:\r\n   [ '/usr/local/lib/node_modules/webpack-dev-server/client/index.js?http://localhost:8080',\r\n     './src/main.js' ],\r\n  output:\r\n   { path: '/',\r\n     filename: 'bundle.js',\r\n     publicPath: '/dist',\r\n     libraryTarget: 'var',\r\n     sourceMapFilename: '[file].map[query]',\r\n     hotUpdateChunkFilename: '[id].[hash].hot-update.js',\r\n     hotUpdateMainFilename: '[hash].hot-update.json',\r\n     crossOriginLoading: false,\r\n     hashFunction: 'md5',\r\n     hashDigest: 'hex',\r\n     hashDigestLength: 20,\r\n     sourcePrefix: '\\t',\r\n     devtoolLineToLine: false },\r\n  module:\r\n   { loaders: [ [Object] ],\r\n     ...\r\n```\r\n\r\n(note different `output.path` in both cases)\r\n\r\nwebpack v1.12.2\r\n\r\ncc @gajus"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/245263073","html_url":"https://github.com/webpack/webpack/issues/1563#issuecomment-245263073","issue_url":"https://api.github.com/repos/webpack/webpack/issues/1563","id":245263073,"user":{"login":"pksjce","id":417268,"avatar_url":"https://avatars.githubusercontent.com/u/417268?v=3","gravatar_id":"","url":"https://api.github.com/users/pksjce","html_url":"https://github.com/pksjce","followers_url":"https://api.github.com/users/pksjce/followers","following_url":"https://api.github.com/users/pksjce/following{/other_user}","gists_url":"https://api.github.com/users/pksjce/gists{/gist_id}","starred_url":"https://api.github.com/users/pksjce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pksjce/subscriptions","organizations_url":"https://api.github.com/users/pksjce/orgs","repos_url":"https://api.github.com/users/pksjce/repos","events_url":"https://api.github.com/users/pksjce/events{/privacy}","received_events_url":"https://api.github.com/users/pksjce/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T12:21:03Z","updated_at":"2016-09-07T12:21:03Z","body":"This issue was moved to webpack/webpack.io#149"}}
{"actor":{"display_login":"pksjce"}}