1.0.3 • Published 5 years ago

qjson-loader v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

⚠️ This loader is resolve the error with in React like this:

    ERROR in xxx.json
    Module build failed (from ./node_modules/json-loader/index.js):
    SyntaxError: Unexpected token ; in JSON at position 12
            at JSON.parse (<anonymous>)
npm install --save-dev qjson-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('qjson-loader!./file.json');

Configuration (recommended)

const json = require('./file.json');

webpack.config.js

module.exports = {
  module: {
    loaders: [
      {
        test: /\.json$/,
        loader: 'qjson-loader'
      }
    ]
  }
}
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago