Как изменить изначально сгенерированный заголовок после сборки файла в index.html

sudo -u postgres createuser -s tom 

это должно помочь вам, поскольку это произойдет, если администратор не создал учетную запись пользователя PostgreSQL для вас. Также может быть указано, что вам присвоено имя пользователя PostgreSQL, отличное от имени пользователя операционной системы, в этом случае вам нужно использовать ключ -U.

0
задан user3402600 17 January 2019 в 06:29
поделиться

1 ответ

Как я понимаю, ваш вопрос - вам нужно настроить файл vue.config.js примерно так (обратите внимание на часть Webpack) - эти файлы из рабочего проекта, поэтому у вас есть максимальное понимание того, как он может посмотрите в конце :

module.exports = {
    baseUrl: '/',
    outputDir: (process.env.NODE_ENV === 'production' ? '../web/' : '../web/js/'),
    indexPath: '../app/Resources/views/index.html.twig',

    // Setting this to false can speed up production builds if you don't need source maps for production.
    productionSourceMap: false,

    // By default, generated static assets contains hashes in their filenames for better caching control.
    // However, this requires the index HTML to be auto-generated by Vue CLI. If you cannot make use of the index HTML
    // generated by Vue CLI, you can disable filename hashing by setting this option to false,
    filenameHashing: false,
    lintOnSave: false,

    // https://cli.vuejs.org/ru/config/#devserver-proxy
    devServer: {},

    // https://cli.vuejs.org/ru/config/#chainwebpack
    chainWebpack: config => {
        config
            .plugin('html')
            .tap(args => {
                args[0].title = 'Ojok Deep Sales Platform';
                args[0].template = './index.html.template';
                return args;
            })
    }
};

И после того, как вы обновили свой vue.config.js файл, измените свой файл шаблона index.html, чтобы он был таким:

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title><%= htmlWebpackPlugin.options.title %></title>
    <link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900' rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Material+Icons" rel="stylesheet">
    <script type="text/javascript" src="../js/go.js"></script>
    <script type="text/javascript" src="../js/momentjs.js"></script>
    <script type="text/javascript" src="../js/webphone/flashphoner.js"></script>
    <script type="text/javascript" src="../js/webphone/SoundControl.js"></script>
</head>

<body>
<div id="app"></div>
</body>
</html>

Pay внимание на то, что включено в тег <title>:

    <title><%= htmlWebpackPlugin.options.title %></title>

После генерации нового файла index.html ваш заголовок должен быть установлен на то, что вы записали в опцию args[0].title.

Надеюсь, это поможет.

0
ответ дан AndrewShmig 17 January 2019 в 06:29
поделиться
Другие вопросы по тегам:

Похожие вопросы: