Closed aaronjensen closed 9 years ago
I figured it out.
Instead of:
resolve.root = path.resolve(__dirname, 'app')
I can do:
resolve.modulesDirectories = ['js']
I'm going to reopen, ideally there's a way to still use root
as the semantics are different. If I can get access to the cache path, I can set the full path.
You may use the parameter of your bootstrap function (the function executes before any tests in each worker) to get the cache folder (projectCacheDir
). Would it suffice?
Sorry, I didn't realise you were talking about Webpack until I have seen what repo this issue is in. The main configuration function (the one config object gets returned from) parameter has the same projectCacheDir
property that you may use to get the cache folder path.
Awesome, yeah, I forgot to update the issue by I discovered this as well. Thanks! Wallaby is amazing btw.
For posterity:
var babel = require('babel');
var wallabyWebpack = require('wallaby-webpack');
var webpackConfig = require('./webpack.wallaby.config');
var path = require('path');
module.exports = function(wallaby) {
webpackConfig.resolve.root = path.join(wallaby.projectCacheDir, 'app');
var wallabyPostprocessor = wallabyWebpack(webpackConfig);
return {...}
};
@aaronjensen Awesome, thanks!
If I use
resolve.root
for my app code, wallaby doesn't see to pick up changes to files that I require viarequire('myfile')
(as opposed torequire('../app/myfile')
.Is there something I can do to set resolve.root to the wallaby cache version of my app dir?