Skip to content

Instantly share code, notes, and snippets.

@wincent
Created Apr 23, 2019
Embed
What would you like to do?
/**
* For windows compatibility, we need to use windows path separators for webpack
* "test" properties.
*/
function toTestRegExp(file) {
return new RegExp(
file.split('/').join(path.sep).replace(/\\/g, '\\')
);
}
const base = {
/**
* https://webpack.js.org/configuration/entry-context/
*/
context: toAbsolute('.'),
/**
* https://webpack.js.org/configuration/module/
*/
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: toAbsolute('./src'),
loader: 'babel-loader',
},
{
test: toTestRegExp('scripts/build/version.js'),
use: {
loader: 'val-loader',
},
},
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment