In the code I have, there is a construction that looks like this:
var getMenu = function () {
return window.fetch("portal/content/json/menu.json").then(function (data) {
return data.json();
});
};
I attempted the following in my webpack.config.js
:
module: {
loaders: [
...
{
test: /\.json$/,
exclude: /node_modules/,
use: [
'file-loader?name=[name].[ext]&outputPath=portal/content/json'
]
},
...
]
}
How the project is structured:
dist
content
json
menu.json <- not found here
src
content
json
menu.json <- original file
The Question:
Is there a way for webpack to move src/content/json/menu.json
to dist/content/json/menu.json
?