{"action":"created","issue":{"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/37","repository_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin","labels_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/37/comments","events_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/37/events","html_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/issues/37","id":305763778,"number":37,"title":"Can filenames support slashes (for directories)?","user":{"login":"benwiley4000","id":13558253,"avatar_url":"https://avatars2.githubusercontent.com/u/13558253?v=4","gravatar_id":"","url":"https://api.github.com/users/benwiley4000","html_url":"https://github.com/benwiley4000","followers_url":"https://api.github.com/users/benwiley4000/followers","following_url":"https://api.github.com/users/benwiley4000/following{/other_user}","gists_url":"https://api.github.com/users/benwiley4000/gists{/gist_id}","starred_url":"https://api.github.com/users/benwiley4000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benwiley4000/subscriptions","organizations_url":"https://api.github.com/users/benwiley4000/orgs","repos_url":"https://api.github.com/users/benwiley4000/repos","events_url":"https://api.github.com/users/benwiley4000/events{/privacy}","received_events_url":"https://api.github.com/users/benwiley4000/received_events","type":"User","site_admin":false},"labels":[{"id":851234025,"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/labels/type:%20Bug","name":"type: Bug","color":"d73a4a","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-16T00:26:23Z","updated_at":"2018-04-17T17:18:19Z","closed_at":"2018-03-29T10:15:00Z","author_association":"NONE","body":"Node 8.9.4 macOS High Sierra 10.13.3\r\n\r\nThanks for this project! It's been great so far.\r\n\r\nAs noted in the readme, the output options are meant to be similar to those for the main webpack config. However, one difference currently is that directory specifications are chopped off the front for the css plugin, while they're respected for JavaScript. It would be great if it were possible to specify a subdirectory under the main output path for CSS assets.\r\n\r\n```js\r\nreturn {\r\n    entry: {\r\n      main: './src/index.js',\r\n    },\r\n    resolve: { extensions: ['.js', '.jsx'] },\r\n    output: {\r\n      path: __dirname + '/dist',\r\n      filename: 'js/[name].js' // <-- JS files end up at ./dist/js/*.js\r\n    },\r\n    module: {\r\n      rules: [\r\n        {\r\n          test: /\\.css$/,\r\n          use: [\r\n            MiniCssExtractPlugin.loader,\r\n            'css-loader'\r\n          ]\r\n        }\r\n      ]\r\n    },\r\n    plugins: [\r\n      new MiniCssExtractPlugin('css/[name].css') // <-- CSS in ./dist/*.css 😲\r\n    ]\r\n  };\r\n```\r\n\r\nP.S. While writing this up I realized it's possible to get what I want by doing:\r\n\r\n```js\r\nplugins: [\r\n  new MiniCssExtractPlugin({\r\n    filename: 'css/[name].css',\r\n    path: __dirname + '/dist/css'\r\n  }) // <-- CSS now in ./dist/css/*.css \r\n]\r\n```\r\n\r\nHowever I would argue the other behavior is still surprising. CSS assets automatically gets placed relative to the main output path if no special path is specified, but **not before stripping off meaningful information.** "},"comment":{"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/comments/382072952","html_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/issues/37#issuecomment-382072952","issue_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/37","id":382072952,"user":{"login":"lukepolo","id":2066668,"avatar_url":"https://avatars1.githubusercontent.com/u/2066668?v=4","gravatar_id":"","url":"https://api.github.com/users/lukepolo","html_url":"https://github.com/lukepolo","followers_url":"https://api.github.com/users/lukepolo/followers","following_url":"https://api.github.com/users/lukepolo/following{/other_user}","gists_url":"https://api.github.com/users/lukepolo/gists{/gist_id}","starred_url":"https://api.github.com/users/lukepolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukepolo/subscriptions","organizations_url":"https://api.github.com/users/lukepolo/orgs","repos_url":"https://api.github.com/users/lukepolo/repos","events_url":"https://api.github.com/users/lukepolo/events{/privacy}","received_events_url":"https://api.github.com/users/lukepolo/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T17:18:19Z","updated_at":"2018-04-17T17:18:19Z","author_association":"NONE","body":"This seems not to work, webpack emits  :\r\n\r\n```\r\n    -   \"/css//js/app.app.css\",\r\n```\r\n\r\n```\r\nnew MiniCssExtractPlugin({\r\n    filename: `${preprocessor.output.segments.path}`, // Path : css/app.css\r\n}\r\n```\r\n\r\nMy app entry point is `js/app` but don't want to follow that entry point for output. \r\n"}}
{"actor":{"display_login":"lukepolo"}}