JT
Size: a a a
JT
IG
./pic.jpg
~@/pic.jpg
JT
JT
./pic.jpg
~@/pic.jpg
Error: Cannot find module '~@/pic.jpg'
JT
IG
JT
A
import picture from './pic.jpg';
...
<img src={picture} alt="img" />
"file-loader": "^6.0.0",
{
test: /\.(png|jpg|jpeg|gif|webp)$/,
use: {
loader: 'file-loader',
options: {
name: isDev ? '[name]-[hash].[ext]' : '[hash].[ext]'
}
}
}
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file
JT
JT
E
JT
JT
IG
IG
JT
JT
A
JT
import from ../../../pic.jpg
и т.п.imagesPath
абсолютный путь к 'public/images/'
и потом внутри компонентов конкатенировать что-то вроде import picture from {imagesPath + 'pic.js'}
Но ничего не вышло, советуют еще в process.env тулитьE