Skip to content
Discussion options

You must be logged in to vote

you don't need webpack or docosaurus plugin for this,

i recommend to create spells.js file that imports all json files, with that source maps are going to point to actual files

import apprentice_blast from './../../data/spells-allura/tier1/apprentice_blast.json'

export {
  apprentice_blast: apprentice_blast,
  // ....
}

or

export const apprentice_blast = require('./../../data/spells-allura/tier1/apprentice_blast.json')

if you rly want to make this in automated way (not tested and most likely not fully working)

const imports = require.context('./../../data/spells-allura/', true, /\.json$/);

const spells = imports.keys().reduce((key, acc) => {
  acc[key] = imports(key);
  return acc;
}, {})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@renatodex
Comment options

Answer selected by renatodex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants