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

    [V1] boot files from "common" directory

    CLI
    4
    18
    708
    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.
    • s.molinari
      s.molinari last edited by

      Sorry, but I have no idea.

      Scott

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

        Well, ok thanks!

        @rstoenescu can you help, please?

        1 Reply Last reply Reply Quote -1
        • labs20
          labs20 last edited by labs20

          Another valid situation: I have a server framework and doing several different apps on same server base, and those apps share some boot files that embed common framework logic and each one still have some exclusive boot files that is individual app logic.

          I suggest that quasar should look for a folder “common” (this name should be configured in quasar.conf) one path up from the project folder, and if it is founded, folders with same name than the ones created on the project folder should be used / recognized.

          + server
          - client
              - _common        //  or "global" or "global_src"
                  + boot       // recognised: global boot files
                  + assets     // recognised: global assets files
                  + my_folder  // ignored OR could be used for imports
              - quasar_app_1
                  - src
                      + assets
                      + boot
                      + etc
              + quasar_app_2
              + quasar_app_N
          
          1 Reply Last reply Reply Quote 0
          • Hawkeye64
            Hawkeye64 last edited by

            I suggest using boot files to import your “common boot files”

            1 Reply Last reply Reply Quote 1
            • s.molinari
              s.molinari last edited by

              @Hawkeye64 - What about builds? Would that idea still work? Does the build system take anything into account outside the /src folder, which btw, @labs20 you are missing in your example folder hierarchy.

              Scott

              labs20 1 Reply Last reply Reply Quote 0
              • labs20
                labs20 @s.molinari last edited by

                @s-molinari said in [V1] boot files from "common" directory:

                /src folder, which btw, @labs20 you are missing in your example folder hierarchy.

                Scott

                uops!! fixed 🙂

                1 Reply Last reply Reply Quote 0
                • rstoenescu
                  rstoenescu Admin last edited by

                  @labs20 Hi,

                  Nothing stopping you from specifying boot files with relative path to the /boot (example: ‘…/…/some/common/folder’). Just make sure that you add that containing folder to quasar.conf.js > build > transpileDependencies. More info: Quasar CLI > quasar.conf.js.

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

                    hummm… ok!

                    Should had tried that before.

                    Thanks.

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

                      Hi, @rstoenescu!

                      Well, it didn’t worked.

                      I’ve tried:

                              boot: [
                                  '../_common/boot/handler.js'
                              ],
                              ...
                              transpileDependencies: [
                                  '../_common/boot',
                              ]
                      

                      and:

                              boot: [
                                  '../_common/boot/handler.js'
                              ],
                              ...
                              transpileDependencies: [
                                  '../_common/boot/',
                              ]
                      

                      and:

                              boot: [
                                  '../_common/boot/handler.js'
                              ],
                              ...
                              transpileDependencies: [
                                  '../_common/boot/handler.js',
                              ]
                      

                      but none worked.

                      The error is:

                       app:dev-server Booting up... +3ms
                      
                       app:progress Compiling SPA... +163ms
                       app:progress Compiled SPA in ~14s +14s
                       ERROR  Failed to compile with 1 errors10:07:58 AM
                      
                      This dependency was not found:
                      
                      * boot/../_common/boot/handler.js in ./.quasar/client-entry.js
                      
                      To install it, you can run: npm install --save boot/../_common/boot/handler.js
                      
                      

                      Any help?

                      1 Reply Last reply Reply Quote 0
                      • s.molinari
                        s.molinari last edited by

                        I think the idea is to use the boot file to import your external common files. Quasar is only looking for a file name (string) for the file in the boot folder.

                        Scott

                        1 Reply Last reply Reply Quote 0
                        • rstoenescu
                          rstoenescu Admin last edited by

                          @labs20 ‘…/_common’ means it resolves to ‘client/quasar_app_1/src’
                          Your path should be ‘…/…/…/_common/…’

                          labs20 1 Reply Last reply Reply Quote 0
                          • labs20
                            labs20 @rstoenescu last edited by

                            @rstoenescu said in [V1] boot files from "common" directory:

                            @labs20 ‘…/_common’ means it resolves to ‘client/quasar_app_1/src’
                            Your path should be ‘…/…/…/_common/…’

                            Yeap! Working like a charm. My bad!

                            Thank you!

                            1 Reply Last reply Reply Quote -1
                            • s.molinari
                              s.molinari last edited by

                              I learned something too. 😁

                              Scott

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