Eric Foster 35b96bc934 initial commit | 6 gadus atpakaļ | |
---|---|---|
.. | ||
.npmignore | 6 gadus atpakaļ | |
CHANGELOG.md | 6 gadus atpakaļ | |
LICENSE | 6 gadus atpakaļ | |
README.md | 6 gadus atpakaļ | |
index.js | 6 gadus atpakaļ | |
package.json | 6 gadus atpakaļ |
npm install --save-dev json-loader
⚠️ Since
webpack >= v2.0.0
, importing of JSON files will work by default. You might still want to use this if you use a custom file extension. See the v1.0.0 -> v2.0.0 Migration Guide for more information
Inline
const json = require('json-loader!./file.json');
Configuration
(recommended)const json = require('./file.json');
webpack.config.js
module.exports = {
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
}
Tobias Koppers |