This repository was archived by the owner on Jan 2, 2018. It is now read-only.

Description
We have some vendor files that are already webpacked, babelified etc. These files have a tendency to break if they run through babel-loader a second time. For the time being, we solve it like this in an action in our roc.config.js-file:
const babelLoader = rocBuilder.buildConfig.module.loaders.find((loaderConfig) => loaderConfig.id === 'babel');
if (babelLoader) {
if (!babelLoader.exclude) {
babelLoader.exclude = [];
}
if (!Array.isArray(babelLoader.exclude)) {
babelLoader.exclude = [babelLoader.exclude];
}
babelLoader.exclude = babelLoader.exclude.concat([
path.resolve('./src/vendor'),
]);
}
return rocBuilder;
It would be really neat if the boilerplate can be hidden, and Roc provided a way to declaratively add paths/RegExps/modules to be hidden from the babel-loader:
settings: {
build: {
loaders: {
babel: {
exclude: [path.resolve('./src/vendor')]
}
}
}
}