Comments (2)
Thanks for report.
I agree it. Probably we can replace it to use fs.
rc-config-loader/src/rc-config-loader.ts
Line 145 in 1796ca8
- const pkgJSON = require(pkgJSONLoc);
+ const pkgJSON = JSON.parse(fs.readFileSync(pkgJSONLoc, "utf-8"));
However, I don't think webpack can bundle files that are loaded dynamically, even if you use fs.
from rc-config-loader.
Thanks for report.
I agree it. Probably we can replace it to use fs.
rc-config-loader/src/rc-config-loader.ts
Line 145 in 1796ca8
- const pkgJSON = require(pkgJSONLoc); + const pkgJSON = JSON.parse(fs.readFileSync(pkgJSONLoc, "utf-8"));However, I don't think webpack can bundle files that are loaded dynamically, even if you use fs.
It can't, that's true, but we don't need it.
However, webpack will not cause any warnings and everything will work as expected.
I was using this package for reading config files in my own project, and it was working fine by itself, but when it's bundled by webpack, this package was not working as expected anymore for god knows which reasons.
I tested it with readFile
instead and everything works as expected with that.
Thank you a lot for your package!
If we can get it working with webpack, it would be fantastic :)
from rc-config-loader.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rc-config-loader.