{"comment":{"url":"https://api.github.com/repos/Glorian/laravel-elixir-webpack-advanced/comments/16891882","html_url":"https://github.com/Glorian/laravel-elixir-webpack-advanced/commit/3afd723f62c6ad1577523265be0df8d28c78a880#commitcomment-16891882","id":16891882,"user":{"login":"Glorian","id":2189913,"avatar_url":"https://avatars.githubusercontent.com/u/2189913?v=3","gravatar_id":"","url":"https://api.github.com/users/Glorian","html_url":"https://github.com/Glorian","followers_url":"https://api.github.com/users/Glorian/followers","following_url":"https://api.github.com/users/Glorian/following{/other_user}","gists_url":"https://api.github.com/users/Glorian/gists{/gist_id}","starred_url":"https://api.github.com/users/Glorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glorian/subscriptions","organizations_url":"https://api.github.com/users/Glorian/orgs","repos_url":"https://api.github.com/users/Glorian/repos","events_url":"https://api.github.com/users/Glorian/events{/privacy}","received_events_url":"https://api.github.com/users/Glorian/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"3afd723f62c6ad1577523265be0df8d28c78a880","created_at":"2016-03-30T08:54:38Z","updated_at":"2016-03-30T08:54:38Z","body":"@chuangbo, yes and no. In general there is no conflict with existing versioning task, because they work in different way. But for sure, you should execute `elixir.version` **before** webpack task.\r\n\r\nWe can't use `elixir.version` for webpack destination files due to the fact that webpack `commonChunksPlugin` extracts some asynchronous modules (if you use `require.ensure`) to separate files, that should be versioned too. So, if we apply `elixir.version` to these async files - our application will break.\r\n\r\nThe best scenario at this moment where we can use both of versioning system is looks like this:\r\n```javascript\r\nconst config = elixir.config;\r\n\r\nelixir(mix => {\r\n\r\n    mix\r\n         .sass('main.scss')\r\n\r\n         //... other tasks\r\n\r\n         /*\r\n          * In second argument, we override destination path for versioned files and rev-manifest.json\r\n          * by default versioned stuff placed here -> \r\n          *           `<config.publicPath>/config.versioning.buildFolder` : public/build\r\n          */\r\n         .version(`${config.css.outputFolder}/main.css`, config.publicPath)\r\n         .webpack('app.js');\r\n\r\n});\r\n```\r\n\r\nBy default webpack task in production mode saves its `rev-manifest.json` in public directory, but if this file existed earlier - webpack will combine it content with its own data. \r\n\r\nThis approach has a major drawback. Laravel's `elixir` helper function couldn't figure out where are versioned assets located because it seeking `rev-manifest` in `public/build` folder, and, as we know, it placed in level up folder.\r\n\r\nSoon I will fix it."}}