Created
November 14, 2017 11:26
-
-
Save joshjung/dc1478b6ab744e43b0752fc877393b3a to your computer and use it in GitHub Desktop.
Asynchronous Webpack Configuration
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
... | |
// Build your configuration object, and then return a Promise | |
let finalConfig = { | |
devtool: 'eval', | |
output: { /* your configuration */ }, | |
plugins: [ /* your configuration */ ] | |
}; | |
module.exports = new Promise(resolve => { | |
getGitAndPackageInformation((gitAndPackageConfiguration) => { | |
// Add something to | |
finalConfig.plugins.unshift(new webpack.DefinePlugin({ | |
__BUILD__: JSON.stringify(gitAndPackageConfiguration) | |
})); | |
resolve(finalConfig); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment