How to set absoulte URL on laravel and vue JS project

Viewed 15

I am building my app using this theme: https://pixinvent.com/demo/vuexy-vuejs-laravel-admin-template/demo-1/dashboard/ecommerce

It's laravel and Vue js.

In this theme I ca see that all images path is related like this :

<img src="/images/_/_/_/_/FeedParserProject/resources/js/src/assets/images/logo/logo.jpeg" alt="logo" class="" style="max-width: 80px;">

For this above path they are using like this way:

:src="require('@/assets/images/projects/xml.png')"

and the vue.config.js file is :

const path = require('path')

module.exports = {
  publicPath: '/',
  lintOnSave: false,
  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          includePaths: ['node_modules', 'resources/assets'],
        },
      },
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@resources': path.resolve(__dirname, 'resources/'),
        '@': path.resolve(__dirname, 'resources/js/src/'),
        '@themeConfig': path.resolve(__dirname, 'resources/js/themeConfig.js'),
        '@core': path.resolve(__dirname, 'resources/js/src/@core'),
        '@validations': path.resolve(__dirname, 'resources/js/src/@core/utils/validations/validations.js'),
        '@axios': path.resolve(__dirname, 'resources/js/src/libs/axios'),
      },
    },
  },
  chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
      .loader('vue-loader')
      .tap(options => {
        // eslint-disable-next-line no-param-reassign
        options.transformAssetUrls = {
          img: 'src',
          image: 'xlink:href',
          'b-avatar': 'src',
          'b-img': 'src',
          'b-img-lazy': ['src', 'blank-src'],
          'b-card': 'img-src',
          'b-card-img': 'src',
          'b-card-img-lazy': ['src', 'blank-src'],
          'b-carousel-slide': 'img-src',
          'b-embed': 'src',
        }
        return options
      })
  },
  transpileDependencies: ['vue-echarts', 'resize-detector'],
}

But I want to make path as absolute, like:

<img src="http://www.localhost:3000/.........." alt="logo" class="" style="max-width: 80px;">

Can you tell me how can I do this?

0 Answers
Related