Created
March 30, 2017 01:13
-
-
Save goldhand/1f4bfa16ff5a66a9b936af03850939ff to your computer and use it in GitHub Desktop.
Webpack - add asset to compilation
This file contains 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
apply(compiler) { | |
compiler.plugin('after-emit', (compilation, callback) => { | |
const file = 'some data'; | |
compilation.assets['foo.js'] = { | |
source: () => file, | |
size: () => Buffer.byteLength(file), | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment