Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 网页包包静态图像_Vue.js_Webpack - Fatal编程技术网

Vue.js 网页包包静态图像

Vue.js 网页包包静态图像,vue.js,webpack,Vue.js,Webpack,我有一个Django API和VueJs前端,在进行开发时,我使用了webpack_bundle_tracker,在查看静态图像时没有问题。现在我已经把它改为生产模式,静态图像不显示 以下是我要加载图像的模板: <div> <img src="@/assets/img/yogavidya-kamp.jpg" alt="yogavidya kamp" class="embed-image"> </di

我有一个Django API和VueJs前端,在进行开发时,我使用了webpack_bundle_tracker,在查看静态图像时没有问题。现在我已经把它改为生产模式,静态图像不显示

以下是我要加载图像的模板:

<div>
    <img src="@/assets/img/yogavidya-kamp.jpg" alt="yogavidya kamp" class="embed-image">
</div>
除静态图像外,所有其他图像均在网页上查看。如何查看图像

谢谢

"<img data-v-851b4448="" src="http://localhost:8080/img/yogavidya-kamp.e656470e.jpg" alt="yogavidya kamp" class="embed-image">"
const BundleTracker = require("webpack-bundle-tracker");

module.exports = {
    // on Windows you might want to set publicPath: "http://127.0.0.1:8080/" 
    publicPath: "https://www.yogavidya.com.tr/", 
    outputDir: './dist/',

    chainWebpack: config => {

        config
            .plugin('BundleTracker')
            .use(BundleTracker, [{filename: './webpack-stats.json'}])

        config.output
            .filename('bundle.js')

        config.optimization
            .splitChunks(false)

        config.resolve.alias
            .set('__STATIC__', 'static')
            .set('__MEDIA__', 'media')

        config.devServer
            // the first 3 lines of the following code have been added to the configuration
            .public('https://www.yogavidya.com.tr/')    
            .host('127.0.0.1')    
            .port(8080)
            .hotOnly(true)
            .watchOptions({poll: 1000})
            .https(false)
            .disableHostCheck(true)
            .headers({"Access-Control-Allow-Origin": ["\*"]})

    },
    

    // uncomment before executing 'npm run build' 
     css: {
         extract: {
           filename: 'bundle.css',
           chunkFilename: 'bundle.css',
         },
    }

};