Friday, 2 June 2017

How to manage configuration for Webpack/Electron app?

I am using Webpack and Electron to build nodejs application. In my project in the root I have directory 'data' where I store configuration in a json like data/configuration.json (in practices there are different files with dynamic names)

After webpackaing though when I call: fs.readdirSync(remote.app.getAppPath()); to get files in the root I get only these packed: [ "default_app.js", "icon.png", "index.html", "main.js", "package.json", "renderer.js" ]

Webpack config is using json-loader and I did not find any documentation mentioning anything special about including specific files or jsons. Or do I have to reference json files in my code differently as they might be packed under main.js.

What is the best practice for Electron/Webpack for managing JSON config files? Am I doing something wrong when webpacking the project?



via Ragnar

No comments:

Post a Comment