I\'m trying to make a bundle with webpack. I have a bit complex dependency: some components require other ones that are located in some /home/.../
folder.
@mqklin: You needed this work-around using, ".map(require.resolve)", because you did not exclude /node_modules/ in your loaders. The format below should work:
loaders: [
{
test: [/\.js$/, /\.es6$/],
exclude: /node_modules/,
loader: 'babel-loader',
query: {
cacheDirectory: true,
presets: ['react', 'es2015'],
}
}
]
How about run
npm init
in /home/.../far-away-components folder, and then use npm to install what you need.
Solution from github issue:
query: {
presets: [
'babel-preset-es2015',
'babel-preset-react',
'babel-preset-stage-0',
].map(require.resolve),
}