Last active
April 29, 2016 00:28
-
-
Save roman01la/8dadfdac46dc0b08d1f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Require hook | |
| function hook(compile, extension) { | |
| require.extensions[extension] = function(m, filename) { | |
| const tokens = compile(filename); | |
| return m._compile('module.exports = ' + JSON.stringify(tokens), filename); | |
| }; | |
| } | |
| // Run require hook | |
| hook(fetch, '.css'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment