Answer the question
In order to leave comments, you need to log in
How to organize files into folders when building webpack 5?
in the output folder /dist
it turns out index.bundle.js
, index.css
and index.html
, and all files get into the same folder after assembling fonts, pictures, and so on.
Is it possible to somehow specify in webpack that he would throw all these pictures, fonts, etc. into a folder, for example , /dist/assets
or pictures into pictures, fonts into fonts, for example /dist/images
, /dist/fonts
without the help of fs, of course.
Answer the question
In order to leave comments, you need to log in
In webpack config:
output: {
path: path.resolve(__dirname, './build'),
filename: 'static/js/[name].[contenthash].js',
crossOriginLoading: 'anonymous'
};
new MiniCssExtractPlugin({ filename: 'static/css/[name].[contenthash].css', ignoreOrder: false }),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question