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

    Where to store and load custom application settings (js vs json)

    Help
    1
    2
    1022
    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.
    • mojimo
      mojimo last edited by mojimo

      I’d like to store my application settings in zSettings.js file which would stay readable after building an application.

      I use static folder but I have a feeling that export default in combination with import always transpile my zSettings.js, so even I change the content it has no influance on application.

      // statics/zSettings.js
      const zSettings = {
        "API": "localhost"
      
      export default zSettings
      

      In my .vue component:

      import zSettings from "../statics/zSettings.js" // editable settings file
      

      Could you help me how to treat custom settings inside .js files or should I keep my settings as .json (where I can not store my comments) and use Webpack with fs to copy it into statics?

      Additional info: Documentation says that “files in static/ are not processed by Webpack at all” but I found out that all my files are processed and compiled (.js files) into webpack files into dist/js folder and copied to statics but settings are used from compiled dist/js folder.

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

        After three days of trying to find a way how to force webpack load .js file and not to compile it I gave up. Back to axios and json.

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