LoginSignup
2
3

More than 3 years have passed since last update.

vue.js で サイト完成後にやっておきたいテスト

Last updated at Posted at 2020-02-13

まぁ、重い。ページがすごく重い。
他の人の作ったvue.jsサイトを見ると 9点とかもある。

重い場合はCSSを別読み込みにするといいかも。
これで 80点以上に上がる。

vue.blade.php

<script type="text/javascript">
    // 非同期でfontawesomeを読み込む
    (function() {
        var css = document.createElement('link'); css.href = 'https://use.fontawesome.com/releases/v5.11.2/css/all.css'; css.rel = 'stylesheet'; css.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(css);
        var css2 = document.createElement('link'); css2.href = '/css/app.css'; css2.rel = 'stylesheet'; css2.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(css2);
        var css3 = document.createElement('link'); css3.href = '/css/lightbox.css'; css3.rel = 'stylesheet'; css3.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(css3);

    })();
</script>

ページスピードテスト
https://developers.google.com/speed/pagespeed/insights/

サーチコンソール
https://search.google.com/search-console/about?hl=ja

・サイトマップは登録してる?
・インデックスされるURLをテストするとちゃんとタイトルタグは変更されてる?

モバイルフレンドリー
https://search.google.com/test/mobile-friendly

・エラー出てない?
・インデックスされるURLをテストするとちゃんとタイトルタグは変更されてる?

テストマイサイト
https://www.thinkwithgoogle.com/intl/ja-jp/feature/testmysite/

すべてやっておきましょう。

webpack.min.js

mix.js('resources/js/app.js','public/js') .version()
   .sass('resources/sass/app.scss','public/css')
   .sass('resources/sass/lightbox.scss','public/css');


こんな感じで version(); をつけておく。
じゃないとnpm run prod するたびにユーザー側にキャッシュが残り、ハードリロードしない限り更新されないというバグになるので。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3