{"action":"created","issue":{"url":"https://api.github.com/repos/heiseonline/shariff/issues/222","repository_url":"https://api.github.com/repos/heiseonline/shariff","labels_url":"https://api.github.com/repos/heiseonline/shariff/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/heiseonline/shariff/issues/222/comments","events_url":"https://api.github.com/repos/heiseonline/shariff/issues/222/events","html_url":"https://github.com/heiseonline/shariff/issues/222","id":229584168,"node_id":"MDU6SXNzdWUyMjk1ODQxNjg=","number":222,"title":"jQuery included twice in webpack bundle because of Shariff","user":{"login":"PhilippSoehnlein","id":242837,"node_id":"MDQ6VXNlcjI0MjgzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/242837?v=4","gravatar_id":"","url":"https://api.github.com/users/PhilippSoehnlein","html_url":"https://github.com/PhilippSoehnlein","followers_url":"https://api.github.com/users/PhilippSoehnlein/followers","following_url":"https://api.github.com/users/PhilippSoehnlein/following{/other_user}","gists_url":"https://api.github.com/users/PhilippSoehnlein/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilippSoehnlein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilippSoehnlein/subscriptions","organizations_url":"https://api.github.com/users/PhilippSoehnlein/orgs","repos_url":"https://api.github.com/users/PhilippSoehnlein/repos","events_url":"https://api.github.com/users/PhilippSoehnlein/events{/privacy}","received_events_url":"https://api.github.com/users/PhilippSoehnlein/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-18T07:52:24Z","updated_at":"2018-11-12T08:58:53Z","closed_at":"2017-05-18T07:52:28Z","author_association":"NONE","body":"Just a small note, maybe someone will get into the same problem and find this solution here:\r\n\r\nI build a website which generates a JavaScript bundle (which should include Shariff) with webpack. This website also has its own jQuery dependency. This leads to jQuery being included twice in the final bundle, when using Shariff 1.24.1 (it should be better with 1.25.1, which was unfortunately rejected). \r\nI think this happens because Shariff 1.24.1 defines jQuery as its own `dependency` instead of defining it as `peerDependency` in the `package.json`.\r\n\r\nNot including jQuery twice can be fixed with the following setting in the `webpack.config.js`:\r\n```js\r\nmodule.exports = {\r\n    // …\r\n    resolve: {\r\n        // …\r\n        alias: {\r\n            // fixate every jQuery requirement to our direct jQuery dependency. Shariff 1.24.1 brings its own jQuery and it would be included twice without this alias.\r\n            'jquery': __dirname + '/node_modules/jquery/',\r\n        },\r\n    },\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/heiseonline/shariff/issues/comments/437804095","html_url":"https://github.com/heiseonline/shariff/issues/222#issuecomment-437804095","issue_url":"https://api.github.com/repos/heiseonline/shariff/issues/222","id":437804095,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzgwNDA5NQ==","user":{"login":"njleonzhang","id":13174059,"node_id":"MDQ6VXNlcjEzMTc0MDU5","avatar_url":"https://avatars1.githubusercontent.com/u/13174059?v=4","gravatar_id":"","url":"https://api.github.com/users/njleonzhang","html_url":"https://github.com/njleonzhang","followers_url":"https://api.github.com/users/njleonzhang/followers","following_url":"https://api.github.com/users/njleonzhang/following{/other_user}","gists_url":"https://api.github.com/users/njleonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/njleonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njleonzhang/subscriptions","organizations_url":"https://api.github.com/users/njleonzhang/orgs","repos_url":"https://api.github.com/users/njleonzhang/repos","events_url":"https://api.github.com/users/njleonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/njleonzhang/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T08:58:53Z","updated_at":"2018-11-12T08:58:53Z","author_association":"NONE","body":"@PhilippSoehnlein Tnx for this information. Have you researched further? Does this a Webpack bug or normal behavior to bundle a lib multi times? "}}
{"actor":{"display_login":"njleonzhang"}}