Skip to content

Output parcel's json files as urls, rather than bundled strings

Notifications You must be signed in to change notification settings

shunia/parcel-plugin-json-url-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

parcel-plugin-json-url-loader

DUB

What

Does exactly the plugin name told: make required or imported json returns url instead of strings.

Why

Lots of users inculding me are suffered from the build-in feature of parcel which bundles json file as strings into the final bundler by default parcel-bundler#501. When people are looking for the official solutions, parcel is still waiting for the solution from react community devongovett@parcel-bundler#501. As a matter of fact, it's something easy to hanle with parcel's plugin system. So I made this.

Installation

yarn add parcel-plugin-json-url-loader --dev
  or
npm i parcel-plugin-json-url-loader --save-dev

Usage

There is no options for you to think of. Just install it and checkout the output:

const jsonPath = require('path/to/json/file.json');
console.log(jsonPath); // /file.3a855491.json

Contribution

There are no tests yet, no linters, no production grade garrentee, and works simply as possible. Any feature requests or bugfixes are welcome.

About

Output parcel's json files as urls, rather than bundled strings

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published