tettusud / merge-jsons-webpack-plugin

This plugin is used to merge json files into single json file,using glob or file names
https://npmjs.com/package/merge-jsons-webpack-plugin
Apache License 2.0
36 stars 20 forks source link

Files watcher #13

Closed dimamarksman closed 7 years ago

dimamarksman commented 7 years ago

I'm wondering if it is possible to add a watcher to track any changes in json and rewrite output file.

dimamarksman commented 7 years ago

It would be useful for working with the webpack devserver

tettusud commented 7 years ago

It should be already happening...get the latest and change a json ,it will compile and emit the output . Please let me know if I didn't get your question right ?

dimamarksman commented 7 years ago

It does not work for me. When i change a json which is not in the webpack entry but in the plugin group pattern it does not rewrite output json file

tettusud commented 7 years ago

How are you starting your webpack dev server ?paste the start script here. It should be working fine ,because previous issue I just fixed and users confirmed its working on their side. Use --inline flag while starting webpack dev server

dimamarksman commented 7 years ago

Thank you for your reply!

I decided to test your repo :)

I cloned this repo and run project locally.

First of all when I try to npm start in the example folder i get an error:

merge-jsons-webpack-plugin\example\node_modules\webpack-dev-server\bin\webpack-dev-server.js:361
   Error: `output.path` needs to be an absolute path or `/`.

I fixed it by:

output: {
     path: path.resolve(__dirname, 'dist'),
     filename: "[name].bundle.js",
}

After it runs and compiles json successfully.

But when I change for instance /jsons/file1.json it does not update ./out/module1/module2/en.json

Cheers

tettusud commented 7 years ago

hi @dimamarksman ,are you still facing the issue? am closing the issue, if you need you can reopen it.