django-manifest-loader icon indicating copy to clipboard operation
django-manifest-loader copied to clipboard

How can I use this with Vue.Js?

Open engin-can opened this issue 3 years ago • 2 comments

Any idea how I can use this with Vue.js? I don't know how to set up my vue.config.js...

engin-can avatar Feb 07 '21 00:02 engin-can

hi @engin-can, can you provide a bit more information? Are you using webpack to bundle your vue app or are you using vue-cli?

Either way you'll need to modify your configuration to output an asset manifest json file. If you share your current config I might be able to point you in the right direction.

rykener avatar Feb 12 '21 21:02 rykener

Here is my config file:

const path = require('path');
const ENV = process.env.NODE_ENV || 'development';
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const DEVSERVER_URL = process.env.DEVSERVER_URL || 'http://127.0.0.1:8080';
const assetsDir = 'frontend/src'; // I keep vue app in the ./frontend directory

module.exports = {
    outputDir: path.resolve('dist'),
    publicPath: process.env.NODE_ENV === 'production' ? '/static/' : DEVSERVER_URL,
    devServer: {
        writeToDisk: true,
        disableHostCheck: true,
        headers: {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
            'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
        },
    },
    chainWebpack(config) {
        config.plugin('webpack-manifest').use(WebpackManifestPlugin);
    },
};

alex-oleshkevich avatar Apr 27 '21 07:04 alex-oleshkevich