This repository has been archived by the owner on Aug 22, 2019. It is now read-only.
Enable Emmet CodeMirror to Work in Webpack/ES6 Environment #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Sergey. I work at CodePen and we just got done integrating Emmet CodeMirror using Webpack/ES6. I wanted to share the changes we needed to make to make it all work.
I was able to properly load Emmet CodeMirror by adding a global reference to the CodeMirror class in the main.setup function. Since we import CodeMirror as a module it isn't available on the window object. I wanted to touch the least amount of code so I stored a reference to the CodeMirror class on window.
I also removed the check that looks for CodeMirror on load.
I then updated the package.json main file to point to emmet-wp.js Last I created a dist action that builds emmet with webpack with the production flag.