{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/5","repository_url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin","labels_url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/5/comments","events_url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/5/events","html_url":"https://github.com/Microsoft/monaco-editor-webpack-plugin/issues/5","id":318192860,"node_id":"MDU6SXNzdWUzMTgxOTI4NjA=","number":5,"title":"Webpack 3 support","user":{"login":"mheavenor","id":2774296,"node_id":"MDQ6VXNlcjI3NzQyOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/2774296?v=4","gravatar_id":"","url":"https://api.github.com/users/mheavenor","html_url":"https://github.com/mheavenor","followers_url":"https://api.github.com/users/mheavenor/followers","following_url":"https://api.github.com/users/mheavenor/following{/other_user}","gists_url":"https://api.github.com/users/mheavenor/gists{/gist_id}","starred_url":"https://api.github.com/users/mheavenor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mheavenor/subscriptions","organizations_url":"https://api.github.com/users/mheavenor/orgs","repos_url":"https://api.github.com/users/mheavenor/repos","events_url":"https://api.github.com/users/mheavenor/events{/privacy}","received_events_url":"https://api.github.com/users/mheavenor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-04-26T20:53:46Z","updated_at":"2018-06-21T08:03:02Z","closed_at":null,"author_association":"NONE","body":"It would be nice if there was support for webpack 3 as well. This is a requirement for me as I am using create-react-app. The below comment also mentions that vue uses webpack 3 as well.\r\n\r\n[This comment](https://github.com/Microsoft/monaco-editor/pull/767#issuecomment-377697621) mentions the problem code. I made the fix as per timkendrick's following comment but ran into issues with `webpack.webworker` being undefined. I changed the way that the `SingleEntryPlugin`, `LoaderTargetPlugin` and `WebWorkerTemplatePlugin` get required and this fix works for me locally. It would be great if this could make it into the repo somehow.\r\n\r\nBelow is my working local version of AddWorkerEntryPointPlugin.js\r\n\r\n```\r\nconst singleEntry = require('webpack/lib/SingleEntryPlugin');\r\nconst loaderTarget = require('webpack/lib/LoaderTargetPlugin');\r\nconst webworker = require('webpack/lib/webworker/WebWorkerTemplatePlugin');\r\n\r\nclass AddWorkerEntryPointPlugin {\r\n  constructor({\r\n    id,\r\n    entry,\r\n    filename,\r\n    chunkFilename = undefined,\r\n    plugins = undefined,\r\n  }) {\r\n    this.options = { id, entry, filename, chunkFilename, plugins };\r\n  }\r\n\r\n  apply(compiler) {\r\n    const { id, entry, filename, chunkFilename, plugins } = this.options;\r\n    compiler.plugin('make', (compilation, callback) => {\r\n      const outputOptions = {\r\n        filename,\r\n        chunkFilename,\r\n        publicPath: compilation.outputOptions.publicPath,\r\n        // HACK: globalObject is necessary to fix https://github.com/webpack/webpack/issues/6642\r\n        globalObject: 'this',\r\n      };\r\n      const childCompiler = compilation.createChildCompiler(id, outputOptions, [\r\n        new webworker(),\r\n        new loaderTarget('webworker'),\r\n        new singleEntry(compiler.context, entry, 'main'),\r\n      ]);\r\n      plugins.forEach((plugin) => plugin.apply(childCompiler));\r\n      childCompiler.runAsChild(callback);\r\n    });\r\n  }\r\n}\r\n\r\nmodule.exports = AddWorkerEntryPointPlugin;\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/comments/399012760","html_url":"https://github.com/Microsoft/monaco-editor-webpack-plugin/issues/5#issuecomment-399012760","issue_url":"https://api.github.com/repos/Microsoft/monaco-editor-webpack-plugin/issues/5","id":399012760,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTAxMjc2MA==","user":{"login":"xeoneux","id":3099626,"node_id":"MDQ6VXNlcjMwOTk2MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/3099626?v=4","gravatar_id":"","url":"https://api.github.com/users/xeoneux","html_url":"https://github.com/xeoneux","followers_url":"https://api.github.com/users/xeoneux/followers","following_url":"https://api.github.com/users/xeoneux/following{/other_user}","gists_url":"https://api.github.com/users/xeoneux/gists{/gist_id}","starred_url":"https://api.github.com/users/xeoneux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeoneux/subscriptions","organizations_url":"https://api.github.com/users/xeoneux/orgs","repos_url":"https://api.github.com/users/xeoneux/repos","events_url":"https://api.github.com/users/xeoneux/events{/privacy}","received_events_url":"https://api.github.com/users/xeoneux/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T08:03:02Z","updated_at":"2018-06-21T08:03:02Z","author_association":"NONE","body":"@brijeshb42 could you create a PR?"}}
{"actor":{"display_login":"xeoneux"}}