Answer the question
In order to leave comments, you need to log in
How to include third-party libraries in the assembly?
Hello! I'm using Webpack and I have a build issue. I have third party folders with fonts and pictures. Is it possible to somehow bind them to the config so that they also appear in the project during the build?
Answer the question
In order to leave comments, you need to log in
If these fonts and images should not be included in the build (and they probably shouldn't), then just put them in the "public directory".
...
// для продакшен конфига
output: {
path: path.join(__dirname, 'production/public/'),
filename: 'bundle.js',
publicPath: '/',
},
...
// для dev конфига
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
...
...
.mac-bg {
background: url(/static/i/service/mac-bg.jpg) no-repeat;
background-size: cover;
}
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question