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

    How do I modify the output key in webpack config

    Help
    3
    4
    785
    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.
    • smellydogcoding
      smellydogcoding last edited by smellydogcoding

      I am trying to implement pdfvuer (which is based on PDF JS) in a project. I keep getting an error in the console: ReferenceError: window is not defined. Based on what I’ve read, this seems to be the solution:

      Edit (or create) vue.config.js and change webpack configuration there:

      module.exports = { configureWebpack: config => { config.output.globalObject = "this"; } }
      

      How do I impliment this in quasar.conf.js?

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

        I found the solution using chainWebpack. Add this to the build section of your quasar.conf.js:

        build: {
          chainWebpack (chain) {
            chain.output.globalObject('this')
          }
        }
        
        1 Reply Last reply Reply Quote 1
        • N
          Nicholas last edited by

          Nice solution. I came across the same error using that package 🙂

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

            @smellydogcoding The best way to insure that your boot file gets loaded in the right place such as Client/Server is in the Boot Section in your quasar.conf.js

            boot: [“i18n”, “axios”, { path: “hello”, server: false }]

            Read more … https://quasar.dev/quasar-cli/developing-ssr/configuring-ssr#Boot-Files

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