Replies: 1 comment 7 replies
-
hello @myasarbardaklar, yes, it is possible. Common solution to hold same folder structure of asset resources in public path is using the property Add to the module.rules in webpack config: {
test: /\.(png|jpg|jpeg|ico|svg|woff2)/, // filter for both images and fonts
type: 'asset/resource',
generator: {
filename: (pathData) => {
const { dir } = path.parse(pathData.filename); // get relative path started with `src/...`
const outputPath = dir.replace('src/', ''); // remove the source dir from path
return outputPath + '/[name].[hash:8][ext]'; // return output path with resource filename
},
},
} The output path If you will use the |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I might have svg files in src/img folder. But I might also have svg files in src/fonts. I wanna seperate them in build time. src/img svg files to dist/img, src/fonts to dist/fonts. Like this.
If i have folder structure like this "src/img/banners" and if i require these images from "src/img/banners", can i have dist folder structure like this "dist/img/banners"? Or just "dist/img"? Because i can have kind of folder structures in src. Like "src/fonts/OpenSans/..." or "src/img/banners/...". I wanna have dist folder like this "dist/fonts/OpenSans/..." or "dist/img/banners/...".
Beta Was this translation helpful? Give feedback.
All reactions