V
V
VIGF2019-05-06 13:05:29
JavaScript
VIGF, 2019-05-06 13:05:29

How to load *.atlas file into React component?

I'm trying to load animation files (json, png, atlas) into the React component.

import * as spinePng3 from './skeleton.png';
import * as spineAtlas3 from './skeleton.atlas';
import * as spineJSON3 from './skeleton.json';

If the files are in the same directory as the component, then everything works. If you put the files in another folder, then the console writes
Module not found: Error: Can't resolve '/ships/untitled.atlas'

The project is being built by Webpack and hasn't found any atlas-loader for it.
How can this problem be solved?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question