How to config webpack config resolve extension in quasar config



  • Hi there I am totally new in front-end development world with Quasar.
    I see some code examples that while import something, sometime they use extension name but sometimes not.
    e.g.
    import DataService from ‘./service/DataService’
    import CourseList from ‘./component/CourseList’
    import App from ‘./App.vue’

    When should I use import with extension name (.vue or .js)?
    And I’ve googled some, look like there is a configuration that webpack use to resolve extension name.
    How to config this in quasar config?

    Original webpack config as below

    resolve: {
        extensions: ['.wasm', '.mjs', '.js', '.json']
      }
    

    Thanks in advance for pointing the way.



  • If you are only looking for .vue and .js importing without the extension, it should work OOTB with Quasar. Anything else, you’d need the proper loader too, for instance for GraphQL files (.gql).

    Scott


Log in to reply