{"id":250,"date":"2020-05-26T13:55:28","date_gmt":"2020-05-26T04:55:28","guid":{"rendered":"http:\/\/localhost:8000\/?p=250"},"modified":"2021-01-16T18:48:31","modified_gmt":"2021-01-16T09:48:31","slug":"vue-firebase-reduce-bundle-size","status":"publish","type":"post","link":"http:\/\/localhost:8000\/2020\/05\/vue-firebase-reduce-bundle-size.html","title":{"rendered":"Vue+Firebase\u3067\u4f5c\u3063\u305f\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30a2\u30d7\u30ea\u306e\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u3092\u524a\u6e1b\u3059\u308b"},"content":{"rendered":"
Vue+Typescript+Firebase\u3067Chrome\u62e1\u5f35\u3092\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u5927\u304d\u3044\u3088\u3068\u8b66\u544a\u304c\u51fa\u305f\u306e\u3067\u5bfe\u5fdc\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\u3042\u3068\u306f\u3001 \u3069\u3046\u3084\u3089\u3001 \u30d0\u30f3\u30c9\u30eb\u304b\u3089\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u524a\u9664\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u3069\u3046\u3084\u3063\u305f\u3089\u30d0\u30f3\u30c9\u30eb\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u542b\u3081\u3089\u308c\u308b\u304b\u3092\u77e5\u3063\u3066\u304a\u304d\u305f\u3044\u3067\u3059\u304c\u3001 \u81ea\u5206\u304c\u77e5\u308b\u7bc4\u56f2\u3067\u3001\u4ee5\u4e0b\u306e\u4e8c\u3064\u306e\u30e1\u30ab\u30cb\u30ba\u30e0\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n webpack\u306f Plugin\u306e\u4e2d\u3067\u3001\u30d0\u30f3\u30c9\u30eb\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u542b\u3081\u308b\u3088\u3046\u306a\u3053\u3068\u3092\u3059\u308b\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002 vue\u95a2\u4fc2\u306e3\u3064\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092CDN\u304b\u3089\u8aad\u307f\u8fbc\u307f\u3001\u30d0\u30f3\u30c9\u30eb\u304b\u3089\u9664\u5916\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n Chrome Extension\u306a\u306e\u3067\u3001\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u6642\u306b\u547c\u3073\u51fa\u3055\u308c\u308b vue\u3068vuetify\u306fmin.js\u30d5\u30a1\u30a4\u30eb\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001 vue\u3068vuetify\u306f\u5b9f\u88c5\u306e\u4e2d\u3067\u4f9d\u5b58\u3057\u3066\u3044\u308b\u306e\u3067\u3001 \u3053\u306e\u8a2d\u5b9a\u3092\u5165\u308c\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u30d0\u30f3\u30c9\u30eb\u30d5\u30a1\u30a4\u30eb vuetify\u306e\u521d\u671f\u5316\u3092\u884c\u306a\u3063\u3066\u3044\u308b \u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u308b\u305f\u3081\u306bimport\u3057\u3066\u3044\u305f \u666e\u901a\u306e\u30a2\u30d7\u30ea\u3067\u306f\u3053\u306e\u8a2d\u5b9a\u306f\u4e0d\u8981\u3067\u3059\u304c\u3001Chrome\u62e1\u5f35\u306e\u5834\u5408\u306f\u30a2\u30d7\u30ea\u5185\u3067\u4e0d\u6b63\u306ajavascript\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u3001content_security_policy<\/a>\u306b\u3088\u3063\u3066\u5b9f\u884c\u53ef\u80fd\u306ajavascript\u30b3\u30fc\u30c9\u3092\u5236\u9650\u3059\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u306e\u8a2d\u5b9a\u3092 \u3061\u306a\u307f\u306b\u3001 firebase\u3082\u540c\u69d8\u306bCDN\u304b\u3089\u8aad\u307f\u8fbc\u307f\u3001\u30d0\u30f3\u30c9\u30eb\u304b\u3089\u9664\u5916\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n \u3053\u3061\u3089\u3082 webpack.config.js\u306eexternals\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002\u63a2\u3059\u3068\u3044\u308d\u3093\u306a\u8a18\u4e8b\u3067\u3044\u308d\u3093\u306a\u6307\u5b9a\u65b9\u6cd5\u304c\u7d39\u4ecb\u3055\u308c\u3066\u307e\u3059\u304c\u3001\u7d50\u5c40\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3067\u554f\u984c\u306a\u304f\u9664\u5916\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n \u3082\u3068\u3082\u3068\u3001node_modules\u306e\u4e0b\u306e \u3053\u3061\u3089\u3082Chrome\u62e1\u5f35\u3067\u4e0a\u8a18\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3001content_security_poricy\u306e\u8a2d\u5b9a\u3092 \u3053\u3053\u307e\u3067\u306e\u5bfe\u5fdc\u3067\u3001\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u306e\u4f9d\u5b58\u95a2\u4fc2\u306b\u3064\u3044\u3066\u306f\u4e00\u901a\u308a\u9664\u5916\u3067\u304d\u305f\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001 \u306b\u306a\u3063\u305f\u306e\u3067\u3001\u307e\u3042\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n \u3067\u3001\u30d0\u30f3\u30c9\u30eb\u306e\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3088\u304f\u898b\u308b\u3068\u3001vuetify\u306ecomponent\u304c\u6b8b\u3063\u3066\u3044\u307e\u3059\u3002\u305f\u3076\u3093\u3053\u308c\u306f \u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306fvuetify\u306eUI\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5229\u7528\u3059\u308b\u7b87\u6240\u3092\u81ea\u52d5\u7684\u306b\u691c\u77e5\u3057\u3066\u3001\u81ea\u52d5\u7684\u306bUI\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306eimport\u3092\u884c\u3063\u3066\u304f\u308c\u308bPlugin\u3067\u304b\u306a\u308a\u4fbf\u5229\u306a\u306e\u3067\u5c0e\u5165\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001CDN\u5316\u3057\u305f\u5f8c\u306f\u305d\u3082\u305d\u3082\u3053\u306eimport\u304c\u4e0d\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n \u3061\u306a\u307f\u306b\u3001import\u306e\u51e6\u7406\u81ea\u4f53\u306f\u3001 \u306a\u306e\u3067\u3001\u5358\u7d14\u306b \u3055\u3089\u306b\u3001package.json\u304b\u3089\u3082\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n \u6539\u3081\u3066\u3001 \u30d0\u30f3\u30c9\u30eb\u306e\u69cb\u6210\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002 vuetify\u306eUI \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u95a2\u4fc2\u3082\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n \u3053\u308c\u306b\u3066\u5bfe\u5fdc\u5b8c\u4e86\uff01\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":" Vue+Typescript+Firebase\u3067Chrome\u62e1\u5f35\u3092\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u5927\u304d\u3044\u3088\u3068\u8b66\u544a\u304c\u51fa\u305f\u306e\u3067\u5bfe\u5fdc\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u4f7f\u3063\u3066\u3044\u308b\u6280\u8853 Chrome Extension Vue+Vuetify TypeScript Firebase Authentication Cloud Firestore \u30ef\u30fc\u30cb\u30f3\u30b0\u306e\u5185\u5bb9 npm run build\uff08cross-env NODE_ENV=production webpack –hide-modules\uff09\u3067\u672c\u756a\u7528\u306e\u30b3\u30fc\u30c9\u3092\u51fa\u529b\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u63a8\u5968\u30b5\u30a4\u30ba\uff08244 KB\uff09\u3092\u8d85\u3048\u3066\u3044\u308b\u3068\u3044\u3046\u30ef\u30fc\u30cb\u30f3\u30b0\u304c\u51fa\u307e\u3057\u305f\u3002 WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). Thi <\/span>Continue Reading<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,12,25],"tags":[],"_links":{"self":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/250"}],"collection":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":1,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":254,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/posts\/250\/revisions\/254"}],"wp:attachment":[{"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/localhost:8000\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}npm run build<\/code>\uff08
cross-env NODE_ENV=production webpack --hide-modules<\/code>\uff09\u3067\u672c\u756a\u7528\u306e\u30b3\u30fc\u30c9\u3092\u51fa\u529b\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u63a8\u5968\u30b5\u30a4\u30ba\uff08244 KB\uff09\u3092\u8d85\u3048\u3066\u3044\u308b\u3068\u3044\u3046\u30ef\u30fc\u30cb\u30f3\u30b0\u304c\u51fa\u307e\u3057\u305f\u3002<\/p>\n
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).\nThis can impact web performance.\nAssets: \n \/fonts\/_\/node_modules\/@mdi\/font\/fonts\/materialdesignicons-webfont.eot (842 KiB)\n \/fonts\/_\/node_modules\/@mdi\/font\/fonts\/materialdesignicons-webfont.woff2 (276 KiB)\n \/fonts\/_\/node_modules\/@mdi\/font\/fonts\/materialdesignicons-webfont.woff (390 KiB)\n \/fonts\/_\/node_modules\/@mdi\/font\/fonts\/materialdesignicons-webfont.ttf (842 KiB)\n options\/options.js (578 KiB)\n popup\/popup.js (1.17 MiB)\n\nWARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.\nEntrypoints:\n popup\/popup (1.17 MiB)\n popup\/popup.js\n options\/options (578 KiB)\n options\/options.js<\/code><\/pre>\n
\u30d0\u30f3\u30c9\u30eb\u69cb\u6210\u3092\u53ef\u8996\u5316<\/h2>\n
webpack-bundle-analyzer<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3001<\/p>\n
npm install --save-dev webpack-bundle-analyzer<\/code><\/pre>\n
webpack.config.js<\/code>\u306bplugin\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n\nconst config = {\n plugins: [\n new BundleAnalyzerPlugin(),\n ]\n}<\/code><\/pre>\n
npm run build<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3001\u81ea\u52d5\u7684\u306b\u30d6\u30e9\u30a6\u30b6\u304c\u7acb\u3061\u4e0a\u304c\u308a\u3001\u30d0\u30f3\u30c9\u30eb\u306e\u69cb\u6210\u8981\u7d20\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002
\n<\/p>\nfirebase<\/code>
vuetify<\/code>
@mdi\/font<\/code>
vue<\/code> \u3092\u6e1b\u3089\u305b\u3070\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n
\u305d\u3082\u305d\u3082\u3001\u30d0\u30f3\u30c9\u30eb\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u542b\u3081\u3089\u308c\u308b\u30e1\u30ab\u30cb\u30ba\u30e0\u306f\uff1f<\/h2>\n
\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n
webpack.config.js<\/code>\u306e
entry<\/code>\u3067\u6307\u5b9a\u3057\u305f\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u4f9d\u5b58\u95a2\u4fc2\u3092\u89e3\u6790\u3057\u3066\u3001\u4f9d\u5b58\u95a2\u4fc2\u306b\u3042\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u308b\u3088\u3046\u3067\u3059\u3002
\n\u3053\u308c\u3092\u30d0\u30f3\u30c9\u30eb\u304b\u3089\u9664\u5916\u3057\u305f\u3044\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5bfe\u5fdc\u3092\u53d6\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n
\n
import<\/code>\u6587\u3084
require()<\/code>\u6587\u3092\u524a\u9664\u3059\u308b<\/li>\n
\n
webpack.config.js<\/code>\u306e
externals<\/code>\u3067\u542b\u3081\u306a\u3044\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u660e\u793a\u7684\u306b\u9664\u5916\u8a2d\u5b9a\u3059\u308b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n
\u30d0\u30f3\u30c9\u30eb\u6642\u306b\u5b9f\u884c\u3055\u308c\u308bPlugin<\/h3>\n
\n\u305d\u306e\u5834\u5408\u3001Plugin\u81ea\u4f53\u3092\u524a\u9664\u3057\u305f\u308a\u3001\u52d5\u4f5c\u3092\u5909\u3048\u305f\u308a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002 <\/p>\n\u30d0\u30f3\u30c9\u30eb\u304b\u3089\u9664\u5916<\/h2>\n
\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n
vue\u30fbvuetify\u30fb@mdi\/font<\/h4>\n
CDN\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f<\/h5>\n
popup.html<\/code>\u304c\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u3067CDN\u304b\u3089 vue<\/a>\u30fbvuetify<\/a>\u30fb@mdi\/font<\/a> \u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n
NODE_ENV === production<\/code>\u306e\u5834\u5408\u306f\u305d\u3061\u3089\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n
<!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <title>Title<\/title>\n+ <link href="https:\/\/fonts.googleapis.com\/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">\n+ <link href="https:\/\/cdn.jsdelivr.net\/npm\/@mdi\/font@5.1.45\/css\/materialdesignicons.min.css" rel="stylesheet">\n+ <link href="https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/dist\/vuetify.min.css" rel="stylesheet">\n <\/head>\n <body>\n <div style="width: 500px;">\n <div id="app">\/div>\n <\/div> \n+ <% if (NODE_ENV === 'production') { %>\n+ <script defer src="https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\/dist\/vue.min.js"><\/script>\n+ <script defer src="https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/dist\/vuetify.min.js"><\/script>\n+ <% } else { %>\n+ <script defer src="https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\/dist\/vue.js"><\/script>\n+ <script defer src="https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/dist\/vuetify.js"><\/script>\n+ <% } %>\n <script defer src="popup.js"><\/script>\n <\/body>\n <\/html><\/code><\/pre>\n
\u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u306a\u3044\u8a2d\u5b9a<\/h5>\n
webpack.config.js<\/code>\u306eexternals<\/a>\u3067\u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u306a\u3044\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002key\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\uff08\uff1dnode_modules\u306e\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u540d\uff09\u3001value\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u540d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u540d\u306f\u4e00\u56de\u52d5\u304b\u3057\u3066\u307f\u3066\u3001Chrome\u306econsole\u3067\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n
+ externals: {\n+ vue: 'Vue',\n+ vuetify: 'Vuetify',\n+ }<\/code><\/pre>\n
popup.js<\/code>\u4e0a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001node_modules\u306e\u4e0b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067\u306f\u306a\u304f\u3001\u5358\u7d14\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
[function(e, r) {\n e.exports = Vue\n}\n, function(e, r) {\n e.exports = Vuetify\n}\n, function(e, r) {\n\uff08\u4e2d\u7565\uff09 \n]<\/code><\/pre>\n
\u30e9\u30a4\u30d6\u30e9\u30ea\u5229\u7528\u7b87\u6240\u306e\u4fee\u6b63<\/h5>\n
vuetify.ts<\/code>\u306e\u4fee\u6b63\u3092\u884c\u3044\u307e\u3059\u3002 <\/p>\n
\n
vuetify\/lib<\/code>\u3067\u306f\u306a\u304f\u3001externals\u3067\u6307\u5b9a\u3057\u305f
vuetify<\/code>\u306b\u5909\u66f4<\/li>\n
@mdi\/font<\/code>\u3092\u524a\u9664<\/p>\n
import Vue from 'vue'\n-import Vuetify from 'vuetify\/lib'\n+import Vuetify from 'vuetify'\n-import '@mdi\/font\/css\/materialdesignicons.css'\n\nVue.use(Vuetify)\n\nexport default new Vuetify({\nicons: {\n iconfont: 'mdi',\n},\n})<\/code><\/pre>\n<\/li>\n<\/ul>\n
\u958b\u767a\u6642\u3082\u53c2\u7167\u3057\u306a\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u524a\u9664<\/h5>\n
vue<\/code>\u3084
vuetify<\/code>\u306f\u958b\u767a\u6642\u306b\u53c2\u7167\u3057\u3066\u3044\u308b\u306e\u3067\u524a\u9664\u3067\u304d\u307e\u305b\u3093\u304c\u3001
@mdi\/font<\/code>\u306f\u3082\u3068\u3082\u3068\u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u308b\u305f\u3081\u3060\u3051\u306binstall\u3057\u3066\u305f\u306e\u3067\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n
npm uninstall @mdi\/font --save<\/code><\/pre>\n
Chrome\u62e1\u5f35\u3067\u5916\u90e8\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8aad\u307f\u8fbc\u3081\u308b\u3088\u3046\u306b\u3059\u308b<\/h5>\n
manifest.json<\/code>\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n
- "content_security_policy": "script-src 'self' ; object-src 'self'"\n+ "content_security_policy": "script-src 'self' https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\/ https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/; object-src 'self'"<\/code><\/pre>\n
vue-web-extension<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001
webpack.config.js<\/code>\u3067\u3053\u306e\u8a2d\u5b9a\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n
firebase<\/h4>\n
CDN\u304b\u3089\u306e\u8aad\u307f\u8fbc\u307f<\/h5>\n
popup.html<\/code>\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002min.js\u304c\u5b58\u5728\u3057\u306a\u3044\u3063\u307d\u3044\u306e\u3067\u3001\u3053\u3061\u3089<\/a>\u3092\u53c2\u8003\u306b\u305d\u306e\u307e\u307e\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\u3061\u306a\u307f\u306b
defer<\/code>\u3092\u3064\u3051\u308b\u3068\u975e\u540c\u671f\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8aad\u307f\u8fbc\u307f\u3001DOMContentLoaded\u306e\u76f4\u524d\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u3089\u3057\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u306e\u65b9\u304cChrome\u306eperformance\u3067\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3068\u3053\u308d\u5c11\u3057\u3060\u3051\u65e9\u304f\u521d\u671f\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u3067\u3057\u305f\u306e\u3067\u3001
defer<\/code>\u3092\u8a2d\u5b9a\u3057\u3066\u3042\u308a\u307e\u3059\u3002<\/p>\n
+ <script defer src="https:\/\/www.gstatic.com\/firebasejs\/7.14.2\/firebase-app.js"><\/script>\n+ <script defer src="https:\/\/www.gstatic.com\/firebasejs\/7.14.2\/firebase-auth.js"><\/script>\n+ <script defer src="https:\/\/www.gstatic.com\/firebasejs\/7.14.2\/firebase-firestore.js"><\/script>\n <script defer src="popup.js"><\/script>\n <\/body><\/code><\/pre>\n
\u30d0\u30f3\u30c9\u30eb\u306b\u542b\u3081\u306a\u3044\u8a2d\u5b9a<\/h5>\n
externals: {\n vue: 'Vue',\n vuetify: 'Vuetify',\n+ firebase: 'firebase',\n }<\/code><\/pre>\n
\n
\n
firebase<\/code>\u3092\u6307\u5b9a\u3059\u308b<\/li>\n<\/ul>\n
\u30e9\u30a4\u30d6\u30e9\u30ea\u5229\u7528\u7b87\u6240\u306e\u4fee\u6b63<\/h5>\n
firebase\/app<\/code>\u3092import\u3057\u3066\u307e\u3057\u305f\u304c\u3001externals\u3067\u6307\u5b9a\u3057\u305f
firebase<\/code>\u306b\u5909\u66f4\u3057\u307e\u3059\u3002
\n\u305d\u306e\u4e0a\u3067\u3001firebase\/auth<\/code>\u3068
firebase\/firestore<\/code>\u306f\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e
firebase<\/code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u3053\u3053\u306eimport\u6587\u306f\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n
-import * as firebase from 'firebase\/app'\n+import * as firebase from 'firebase'\n-import 'firebase\/auth'\n-import 'firebase\/firestore'\n\n const firebaseConfig: { [key: string]: string } = {\n }\n\n firebase.initializeApp(firebaseConfig)\n\n export default firebase<\/code><\/pre>\n
Chrome\u62e1\u5f35\u3067\u5916\u90e8\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8aad\u307f\u8fbc\u3081\u308b\u3088\u3046\u306b\u3059\u308b<\/h5>\n
manifest.json<\/code>\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002\u3061\u306a\u307f\u306b\u3001\u6307\u5b9a\u3057\u305fURL\u306e\u6700\u5f8c\u306e
\/<\/code>\u306f\u5fc5\u8981\u3067\u3059\u3002<\/p>\n
- "content_security_policy": "script-src 'self' https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\/ https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/; object-src 'self'"\n+ "content_security_policy": "script-src 'self' https:\/\/www.gstatic.com\/firebasejs\/ https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\/ https:\/\/cdn.jsdelivr.net\/npm\/vuetify@2.2.27\/; object-src 'self'"<\/code><\/pre>\n
\u7d50\u679c\u78ba\u8a8d<\/h4>\n
npm run build<\/code>\u3067\u672c\u756a\u7528\u306e\u30b3\u30fc\u30c9\u3092\u51fa\u529b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u3059\u308b\u3068\u3001\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u63a8\u5968\u30b5\u30a4\u30ba\uff08244 KB\uff09\u3092\u8d85\u3048\u3066\u3044\u308b\u3068\u3044\u3046\u30ef\u30fc\u30cb\u30f3\u30b0\u306f\u51fa\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n
options\/options.js (48.3 KiB)\n popup\/popup.js (145 KiB)<\/code><\/pre>\n
\n<\/p>\nvuetify-loader<\/code>\u306e
VuetifyLoaderPlugin<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u305f\u3081\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u306e\u3067\u3001\u6b21\u306f\u3053\u308c\u3092\u5bfe\u5fdc\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n
\u30d0\u30f3\u30c9\u30eb\u6642\u306b\u5b9f\u884c\u3055\u308c\u308bPlugin<\/h3>\n
VuetifyLoaderPlugin<\/h4>\n
loader.js<\/code>\u306e\u4e2d\u306e\u4ee5\u4e0b\u306e\u3042\u305f\u308a\u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n
function install (install, content, imports) {\n if (imports.length) {\n let newContent = '\/* vuetify-loader *\/\\n'\n newContent += `import ${install} from ${loaderUtils.stringifyRequest(this, '!' + runtimePaths[install])}\\n`\n newContent += imports.map(i => i[1]).join('\\n') + '\\n'\n newContent += `${install}(component, {${imports.map(i => i[0]).join(',')}})\\n`\n\n \/\/ Insert our modification before the HMR code\n const hotReload = content.indexOf('\/* hot reload *\/')\n if (hotReload > -1) {\n content = content.slice(0, hotReload) + newContent + '\\n\\n' + content.slice(hotReload)\n } else {\n content += '\\n\\n' + newContent\n }\n }\n\n return content\n}<\/code><\/pre>\n
Plugin\u306e\u524a\u9664<\/h4>\n
webpack.config.js<\/code>\u304b\u3089\u8a72\u5f53\u306ePlugin\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n
const { version } = require('.\/package.json');\n-const VuetifyLoaderPlugin = require('vuetify-loader\/lib\/plugin');\n const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\n (\u4e2d\u7565)\n plugins: [\n new BundleAnalyzerPlugin(),\n- new VuetifyLoaderPlugin(),<\/code><\/pre>\n
npm uninstall vuetify-loader --save<\/code><\/pre>\n
\u7d50\u679c\u78ba\u8a8d<\/h4>\n
npm run build<\/code>\u3067\u30d0\u30f3\u30c9\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u51fa\u529b\u3057\u306a\u304a\u3059\u3068\u3001\u3055\u3089\u306b\u30d0\u30f3\u30c9\u30eb\u30b5\u30a4\u30ba\u304c\u524a\u6e1b\u3067\u304d\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n
options\/options.js (16.5 KiB)\n popup\/popup.js (21.2 KiB)<\/code><\/pre>\n
\n<\/p>\n