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

json files not generating #71

Open ricardovanlaarhoven opened 3 years ago

ricardovanlaarhoven commented 3 years ago

I'm trying to merge all json files into one for vue-i18n

this is my vue.config.js

...
configureWebpack: {
    plugins: [
      new MergeJsonWebpackPlugin({
        'debug': true,
        'output': {
          'groupBy': [
            {
              'pattern': 'src/locales/nl/*.json',
              'fileName': 'src/locales/nl.json',
            },
          ],
        },
        'globOptions': {
          'nosort': true,
        },
      }),
    ],
  },
...

resulting in

> vue-cli-service serve

MergeJsonWebpackPlugin :: {
  "debug": true,
  "encoding": "utf8",
  "overwrite": true,
  "output": {
    "groupBy": [
      {
        "pattern": "src/locales/nl/*.json",
        "fileName": "src/locales/nl.json"
      }
    ]
  },
  "globOptions": {
    "nosort": true
  }
}
 INFO  Starting development server...
MergeJsonWebpackPlugin :: Running apply() ::::::
98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 error                                                                                                                                                                                      10:24:58

This dependency was not found:

* @/locales/nl.json in ./src/plugins/i18n.js

To install it, you can run: npm install --save @/locales/nl.json

How can I make sure this file is generating? And am I using this plugin correctly?