{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/246","repository_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin","labels_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/246/comments","events_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/246/events","html_url":"https://github.com/webpack/extract-text-webpack-plugin/issues/246","id":177089186,"number":246,"title":"publicPath parameter doesn't work?","user":{"login":"yugasun","id":8536173,"avatar_url":"https://avatars.githubusercontent.com/u/8536173?v=3","gravatar_id":"","url":"https://api.github.com/users/yugasun","html_url":"https://github.com/yugasun","followers_url":"https://api.github.com/users/yugasun/followers","following_url":"https://api.github.com/users/yugasun/following{/other_user}","gists_url":"https://api.github.com/users/yugasun/gists{/gist_id}","starred_url":"https://api.github.com/users/yugasun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yugasun/subscriptions","organizations_url":"https://api.github.com/users/yugasun/orgs","repos_url":"https://api.github.com/users/yugasun/repos","events_url":"https://api.github.com/users/yugasun/events{/privacy}","received_events_url":"https://api.github.com/users/yugasun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-15T05:02:15Z","updated_at":"2016-11-11T04:36:13Z","closed_at":null,"body":"When I use extract-text-webpack-plugin output css file into a folder, the image url is wrong, my webpack config is below:\n\n```\n\"use strict\";\nvar path = require('path');\nvar webpack = require('webpack');\n\n// webpack plugins\nvar HtmlWebpackPlugin = require('html-webpack-plugin');\nvar ExtractTextPlugin = require('extract-text-webpack-plugin');\n\n\nmodule.exports = {\n    entry: path.resolve(__dirname, 'app/scripts/main.js'),\n    output: {\n        path: path.resolve(__dirname, \"build\"),\n        //publicPath: path.resolve(__dirname, \"build\"),\n        filename: 'js/[name]-[hash].js'\n    },\n    module: {\n        loaders: [\n            {\n                test: /\\.jsx?$/,   \n                loader: 'babel',    \n                exclude: /(node_modules|bower_components)/,\n                query: {\n                    presets: ['react', 'es2015']\n                }\n            },\n            {\n                test: /\\.scss$/,\n                exclude: /(node_modules|bower_components)/,\n                loader: ExtractTextPlugin.extract('style', 'css!sass!postcss')\n            },\n            {\n                test: /\\.css$/,\n                exclude: /(node_modules|bower_components)/,\n                loader: ExtractTextPlugin.extract('style', 'css!postcss')\n            },\n            {\n                test: /\\.(woff|woff2|svg|eot|ttf)/,\n                loader: 'url?prefix=font/&limit=10000'\n            },\n            {\n                test: /\\.(png|jpe?g|gif|svg)$/,\n                loaders: [\n                    'file?name=images/[name].[ext]',\n                    //'image-webpack'\n                ]\n            }\n        ]\n    },\n\n    // image handle\n    //imageWebpackLoader: {\n    //    progressive: true,\n    //    optimizationLevel: 3,\n    //    interlaced: false,\n    //    pngquant: {quality: \"65-70\", speed: 4}\n    //},\n\n    postcss: [\n        require('autoprefixer')\n    ],\n\n    plugins: [\n        new webpack.BannerPlugin('This file is created by yugasun'),\n        new HtmlWebpackPlugin({\n            title: 'RedChild',\n            template: __dirname + '/app/template/index.tmpl.html'\n        }),\n        new webpack.optimize.OccurenceOrderPlugin(),\n        new webpack.optimize.UglifyJsPlugin(),\n        new ExtractTextPlugin('css/[name]-[hash].css')\n    ]\n};\n```\n\nmy output 'build' folder tree like this:\n\n```\n.\n├── css\n│   └── main-72c33a6c0ad73a5a0403.css\n├── images\n│   ├── arrow.png\n|   |.....\n│   └── wrong_title.png\n├── index.html\n└── js\n    └── main-72c33a6c0ad73a5a0403.js\n```\n\nBut in my output css file the image url is 'images/arrow.png', what I want is like '../images/arrow.png'.\n\nThen I add the extract-text-webpack-plugin options like below:\n\nChange:\n\n```\nnew ExtractTextPlugin('css/[name]-[hash].css')\n```\n\nTo: \n\n```\nnew ExtractTextPlugin('css/[name]-[hash].css', {\n            publicPath: '../'\n        })\n```\n\nBut the parameter 'publicPath' doesn't work,  in my output css file the image url is still 'images/arrow.png'.\n\nMy package.json is like bellow:\n\n```\n{\n  \"name\": \"h5-webpack-template\",\n  \"version\": \"1.0.0\",\n  \"description\": \"H5 Develop template.\",\n  \"main\": \"bundle.js\",\n  \"scripts\": {\n    \"dev\": \"webpack-dev-server --progress --colors --content-base build --port 8014 --host 0.0.0.0\",\n    \"build\": \"NODE_ENV=production webpack --config ./webpack.production.js --progress\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/yugasun/H5%2Bwebpack.git\"\n  },\n  \"keywords\": [\n    \"webpack\",\n    \"ES6\",\n    \"HTML5\"\n  ],\n  \"author\": \"yugasun\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"autoprefixer\": \"^6.4.0\",\n    \"babel-core\": \"^6.13.2\",\n    \"babel-loader\": \"^6.2.4\",\n    \"babel-preset-es2015\": \"^6.13.2\",\n    \"babel-preset-react\": \"^6.11.1\",\n    \"clean-webpack-plugin\": \"^0.1.10\",\n    \"css-loader\": \"^0.21.0\",\n    \"extract-text-webpack-plugin\": \"^1.0.1\",\n    \"file-loader\": \"^0.8.5\",\n    \"html-webpack-plugin\": \"^2.22.0\",\n    \"image-webpack-loader\": \"^2.0.0\",\n    \"imagemin-webpack-plugin\": \"^1.0.8\",\n    \"node-sass\": \"^3.4.2\",\n    \"normalize.css\": \"^4.2.0\",\n    \"postcss-loader\": \"^0.9.1\",\n    \"sass-loader\": \"^3.1.2\",\n    \"style-loader\": \"^0.13.0\",\n    \"url-loader\": \"^0.5.7\",\n    \"webpack\": \"^1.13.2\",\n    \"webpack-dev-server\": \"^1.15.2\",\n    \"webpack-spritesmith\": \"^0.2.6\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/yugasun/H5%2Bwebpack/issues\"\n  },\n  \"homepage\": \"https://github.com/yugasun/H5%2Bwebpack#readme\",\n  \"dependencies\": {\n    \"weui\": \"^0.4.3\"\n  }\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/comments/259879365","html_url":"https://github.com/webpack/extract-text-webpack-plugin/issues/246#issuecomment-259879365","issue_url":"https://api.github.com/repos/webpack/extract-text-webpack-plugin/issues/246","id":259879365,"user":{"login":"adamgotterer","id":223498,"avatar_url":"https://avatars.githubusercontent.com/u/223498?v=3","gravatar_id":"","url":"https://api.github.com/users/adamgotterer","html_url":"https://github.com/adamgotterer","followers_url":"https://api.github.com/users/adamgotterer/followers","following_url":"https://api.github.com/users/adamgotterer/following{/other_user}","gists_url":"https://api.github.com/users/adamgotterer/gists{/gist_id}","starred_url":"https://api.github.com/users/adamgotterer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamgotterer/subscriptions","organizations_url":"https://api.github.com/users/adamgotterer/orgs","repos_url":"https://api.github.com/users/adamgotterer/repos","events_url":"https://api.github.com/users/adamgotterer/events{/privacy}","received_events_url":"https://api.github.com/users/adamgotterer/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T04:36:12Z","updated_at":"2016-11-11T04:36:12Z","body":"I've played with the config and tens of combinations for hours without even a hint of it doing anything. Any work arounds?"}}
{"actor":{"display_login":"adamgotterer"}}