Skip to content

Instantly share code, notes, and snippets.

@ndelangen
Created July 29, 2019 12:31
Show Gist options
  • Save ndelangen/60c3fbc06b069f1fe0bea1f7cf12dd00 to your computer and use it in GitHub Desktop.
Save ndelangen/60c3fbc06b069f1fe0bea1f7cf12dd00 to your computer and use it in GitHub Desktop.
Using other config properties
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