Answer the question
In order to leave comments, you need to log in
How to easily move a file from one folder to another using Webpack?
Hey! Explain how you can easily (without other manipulations) move files from one folder to another
using Webpack ?
For example, from src / js to dist / js
Fonts "move" for me like this
{
test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file-loader',
options: {
name: '/[name]/[name].[ext]',
outputPath: 'fonts/',
},
},
Answer the question
In order to leave comments, you need to log in
test does not specify a relative path, but a regular expression. By parsing this regular expression, webpack will understand which files to apply the loader to.
In order to write the correct regular expression, you need to know which files you need to move.
for example, there is an online regular expression tester here, you can practice there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question