Created
July 29, 2019 12:31
-
-
Save ndelangen/60c3fbc06b069f1fe0bea1f7cf12dd00 to your computer and use it in GitHub Desktop.
Using other config properties
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
export const webpack = async (base, config) => { | |
const { default: webpackMerge } = await import('webpack-merge'); | |
const { default: globToRegex } = await import('glob-to-regexp'); | |
// here we request the resulting entries property | |
// and transform the array of globs to an array of regular expressions | |
const entries = (await config.entries).map(globToRegex); | |
return webpackMerge(base, { | |
module: { | |
rules: [{ | |
test: entries, | |
loader: 'some-custom-loader', | |
}], | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment