Соединяю Django и React.js по
этой статье. файлы такие же + файл babel.config.json :
{
"presets": ["@babel/preset-react", "@babel/preset-env"],
"plugins": ["@babel/plugin-transform-react-jsx"]
}
После команды npm run dev компиляция проходит без ошибок, но файл main.js после неё остаётся пустым. Лог компиляции:
[webpack-cli] Compilation finished
asset main.js 1.02 MiB [emitted] (name: main)
runtime modules 668 bytes 3 modules
modules by path ./node_modules/ 979 KiB
modules by path ./node_modules/scheduler/ 31.8 KiB 4 modules
modules by path ./node_modules/react/ 70.6 KiB
./node_modules/react/index.js 190 bytes [built] [code generated]
./node_modules/react/cjs/react.development.js 70.5 KiB [built] [code generated]
modules by path ./node_modules/react-dom/ 875 KiB
./node_modules/react-dom/index.js 1.33 KiB [built] [code generated]
./node_modules/react-dom/cjs/react-dom.development.js 874 KiB [built] [code generated]
./node_modules/object-assign/index.js 2.06 KiB [built] [code generated]
modules by path ./src/ 3.63 KiB
./src/index.js 38 bytes [built] [code generated]
./src/components/App.js 3.59 KiB [built] [code generated]
./static/frontend/main.js 1 bytes [built] [code generated]
webpack 5.3.2 compiled successfully in 3051 ms
В чём причина?