D
D
Denis786562018-02-09 11:04:09
JSON
Denis78656, 2018-02-09 11:04:09

How to access json through webpack?

Hey!
I include in the js file:
let name = require('../hello.json');
Webpack does build, json file is copied to build folder using file-loader. But if we run the js file created by webpack
and refer to the name variable, we will get that
name = '../hello.json'
.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly Zharov, 2018-02-09
@Denis78656

should use raw-loader instead of file-loader

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question