Answer the question
In order to leave comments, you need to log in
How to pass [name] entry point to file-loader/url-loader in webpack 4?
Hello.
The task is to set up WP4 for small projects, where N is the number of entry points.
entry: {
app1: './src/App1/main.js',
app2: './src/App2/main.js',
....
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name]/js/script.js',
},
module: {
rules: [
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
name: utils.assetsPath('[name].[hash:7].[ext]'),
publicPath ...
}
Answer the question
In order to leave comments, you need to log in
The easiest way is to create a folder in pictures, for a specific entry point
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question