Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use this with Vue.Js? #41

Open
engin-can opened this issue Feb 7, 2021 · 2 comments
Open

How can I use this with Vue.Js? #41

engin-can opened this issue Feb 7, 2021 · 2 comments
Labels
best practices documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested

Comments

@engin-can
Copy link

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

@rykener rykener added best practices documentation Improvements or additions to documentation help wanted Extra attention is needed labels Feb 12, 2021
@rykener
Copy link
Owner

rykener commented Feb 12, 2021

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 rykener added the question Further information is requested label Feb 16, 2021
@alex-oleshkevich
Copy link

alex-oleshkevich commented Apr 27, 2021

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);
    },
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practices documentation Improvements or additions to documentation help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants