Skip to content

Instantly share code, notes, and snippets.

@nabigraphics
Created November 2, 2020 16:53
Show Gist options
  • Save nabigraphics/960c212b1500f41dd8373d68a3764334 to your computer and use it in GitHub Desktop.
Save nabigraphics/960c212b1500f41dd8373d68a3764334 to your computer and use it in GitHub Desktop.
const path = require("path");
module.exports = {
webpack: (config, { defaultLoaders }) => {
config.resolve.modules.push(path.join(__dirname, "../../packages/"));
const resolvedBaseUrl = path.resolve(config.context, "../../packages/");
config.module.rules = [
...config.module.rules,
{
test: /\.(tsx|ts|js|mjs|jsx)$/,
include: [resolvedBaseUrl],
use: defaultLoaders.babel,
exclude: excludePath => {
return /node_modules/.test(excludePath);
}
}
];
return config;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment