@zapalagrzegorz wrote:
Hey,
Just starting with Ember.
Trying to mock some data with prepared JSON. It’s theoretically possible, according to SO to import json into JS with Babel using following syntax:
1. import * as data from './example.json'; 2. word = data.name; 3. console.log(word); // output 'testing'
But keep getting error:
Could not find module
.../tests/acceptance/example.json
imported from.../tests/acceptance/page-report-test
A simple workaround from S:
config.js
export default { // my json here... }
then…
import config from '../config.js'
does not allow import of existing .json files, but does a job.
Thanks in advance
Posts: 1
Participants: 1