No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    [SOLVED] How to add a webpack plugin (and require file)?

    Framework
    1
    3
    3419
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ssuess
      ssuess last edited by ssuess

      I am trying to use this plugin (https://www.npmjs.com/package/merge-jsons-webpack-plugin) and integrate with quasar.conf.js. But when I add

      let MergeJsonWebpackPlugin = require("merge-jsons-webpack-plugin")
      

      to the top of my quasar config file, I get an error: (node:21762) UnhandledPromiseRejectionWarning: ReferenceError: Cannot access 'dev' before initialization I have also tried moving the line to inside the module.exports block, but also it fails. my extend code and build block itself looks like this:

      build: {
            rtl: true,
            scopeHoisting: true,
            vueRouterMode: 'history',
            // vueCompiler: true,
            // gzip: true,
            // analyze: true,
            // extractCSS: false,
            extendWebpack (cfg) {
              cfg.resolve.alias['vue'] = 'vue/dist/vue.common'
              cfg.module.rules.push({
                enforce: 'pre',
                test: /\.(js|vue)$/,
                loader: 'eslint-loader',
                exclude: /node_modules/
              }),
              cfg.module.rules.push({
                resourceQuery: /blockType=i18n/,
                type: 'javascript/auto',
                use: [
                  {loader: '@kazupon/vue-i18n-loader'}
                ]
              }),
              cfg.plugins.push(
                new MergeJsonWebpackPlugin({
                  "files": [
                    "./jsons/file1.json",
                    "./jsons/file3.json",
                    "./jsons/file2.json"
                  ],
                  "output": {
                    "fileName": "./dist/result.json"
                  }
                })
              )
            }
          },
      

      Any ideas how to get this plugin to work/load?

      1 Reply Last reply Reply Quote 0
      • ssuess
        ssuess last edited by

        Any suggestions at all? I’m totally stuck with this.

        1 Reply Last reply Reply Quote 0
        • ssuess
          ssuess last edited by

          Good news, this was fixed by updating to the most recent quasar (from 1.8.2 to 1.8.3), so I guess the bug was there because the rest of my code remained exactly as above.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post