before webpack compile, create directory symlink.
npm install webpack-symlink-pluginconst WebpackSymlinkPlugin = require("webpack-symlink-plugin");
const webpackConfig = {
plugins: [
new WebpackSymlinkPlugin(options),
],
};
module.exports = webpackConfig;new WebpackSymlinkPlugin({
// multi symlink maps
symlinkList: [
{
// absolute path to source
src: "path/to/src/directory",
// absolute path to destination
dest,
},
],
// success callback
onSuccess: function() {},
})