From 751921ee6fde5f1e6204c5ca50a0606f9c3c720e Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Wed, 1 Nov 2017 23:56:20 +0100 Subject: [PATCH 1/9] chore(index.html): removed useless meta --- src/index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.html b/src/index.html index 6a38cf7..36e11d9 100644 --- a/src/index.html +++ b/src/index.html @@ -7,8 +7,6 @@ Polymer Skeleton - - From 7a71cac448721efcfc71841ac20feefa2cab8daa Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Thu, 2 Nov 2017 00:00:58 +0100 Subject: [PATCH 2/9] fix(#72): removed manifest from icons --- src/assets/icons/manifest.json | 18 ------------------ src/manifest.json | 21 --------------------- 2 files changed, 39 deletions(-) delete mode 100644 src/assets/icons/manifest.json diff --git a/src/assets/icons/manifest.json b/src/assets/icons/manifest.json deleted file mode 100644 index c8e8e30..0000000 --- a/src/assets/icons/manifest.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "", - "icons": [ - { - "src": "/assets/icons/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "/assets/icons/android-chrome-384x384.png", - "sizes": "384x384", - "type": "image/png" - } - ], - "theme_color": "#ffffff", - "background_color": "#ffffff", - "display": "standalone" -} \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 828745c..e69de29 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,21 +0,0 @@ -{ - "name": "Polymer Skeleton", - "short_name": "PX Skeleton", - "icons": [{ - "src": "/images/logos/p-logo-32.png", - "type": "image/png", - "sizes": "32x32" - }, { - "src": "/images/logos/p-logo-192.png", - "type": "image/png", - "sizes": "192x192" - }, { - "src": "/images/logos/p-logo-512.png", - "type": "image/png", - "sizes": "512x512" - }], - "start_url": "/", - "display": "standalone", - "background_color": "#eceff1", - "theme_color": "#2e9be6" -} From 05de895a3232b08c982e5c8dc364250205df3a20 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Thu, 2 Nov 2017 00:01:41 +0100 Subject: [PATCH 3/9] fix(#72): re-added manifest inside src root --- src/manifest.json | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/manifest.json b/src/manifest.json index e69de29..535b387 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "", + "icons": [{ + "src": "/assets/icons/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/assets/icons/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} From 5dd74433c9c2ac52b71847a6b2ac814dca3c75f8 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Thu, 2 Nov 2017 00:05:08 +0100 Subject: [PATCH 4/9] fix(#75): fixed builds order --- package.json | 2 +- webpack-module-build.config.js | 6 +++++- webpack.config.js | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ec89126..b5ccaf7 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "Mattia Astorino (http://equinsuocha.io/)" ], "scripts": { + "prebuild": "NODE_ENV=production webpack --config webpack-module-build.config.js", "build": "NODE_ENV=production webpack --optimize-minimize", - "postbuild": "NODE_ENV=production webpack --config webpack-module-build.config.js", "dev": "webpack-dev-server --hot --inline", "dev:module": "BROWSERS=module webpack-dev-server --hot --inline", "pretest": "yarn linkbower && yarn build", diff --git a/webpack-module-build.config.js b/webpack-module-build.config.js index 6f30201..a597926 100644 --- a/webpack-module-build.config.js +++ b/webpack-module-build.config.js @@ -1,5 +1,6 @@ const {resolve} = require('path'); const webpack = require('webpack'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); const pkg = require('./package.json'); @@ -16,7 +17,10 @@ const processEnv = { /** * Plugin configuration */ -const plugins = [new webpack.DefinePlugin({'process.env': processEnv})]; +const plugins = [ + new webpack.DefinePlugin({'process.env': processEnv}), + new CleanWebpackPlugin([outputPath], {verbose: true}) +]; /** * === Webpack configuration diff --git a/webpack.config.js b/webpack.config.js index d8194fd..a8f2911 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,6 @@ const {resolve, join} = require('path'); const webpack = require('webpack'); const WorkboxPlugin = require('workbox-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -const CleanWebpackPlugin = require('clean-webpack-plugin'); const pkg = require('./package.json'); @@ -71,7 +70,6 @@ const plugins = isDev ? [ new CopyWebpackPlugin( [].concat(copyStatics.copyWebcomponents, copyStatics.copyOthers) ), - new CleanWebpackPlugin([outputPath], {verbose: true}), new webpack.DefinePlugin({'process.env': processEnv}) ]; From ba1732c4f0855ce874b7cc966cf4a9814671ca2c Mon Sep 17 00:00:00 2001 From: Max Knee Date: Fri, 3 Nov 2017 10:19:50 -0400 Subject: [PATCH 5/9] Add svgs and pngs to serviceworker --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index a8f2911..dbf337c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -64,7 +64,7 @@ const plugins = isDev ? [ ] : [ new WorkboxPlugin({ globDirectory: outputPath, - globPatterns: ['**/*.{html,js,css}'], + globPatterns: ['**/*.{html,js,css, svg, png}'], swDest: join(outputPath, 'sw.js') }), new CopyWebpackPlugin( From 5777ee64591ef873d5c07315805c47d7f0fd38ff Mon Sep 17 00:00:00 2001 From: Burak Date: Sun, 5 Nov 2017 13:11:33 +0100 Subject: [PATCH 6/9] Extend WorkboxJS for Fonts Let Service-Worker cache fonts, too --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index a8f2911..107eeb6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -64,7 +64,7 @@ const plugins = isDev ? [ ] : [ new WorkboxPlugin({ globDirectory: outputPath, - globPatterns: ['**/*.{html,js,css}'], + globPatterns: ['**/*.{html, js, css, svg, png, woff, woff2, ttf}'], swDest: join(outputPath, 'sw.js') }), new CopyWebpackPlugin( From e37f75a4fa1e8944b742771d95ed2bfffc69c31d Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Tue, 28 Nov 2017 21:10:56 +0100 Subject: [PATCH 7/9] feat(webcomponents-loader): re-added with correct logic --- src/index.html | 18 ++++++++++++++++++ webpack.config.js | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/src/index.html b/src/index.html index 36e11d9..aeb8577 100644 --- a/src/index.html +++ b/src/index.html @@ -70,6 +70,24 @@ } else { console.log('Service worker is not supported'); } + + document.addEventListener('WebComponentsReady', function componentsReady() { + document.removeEventListener('WebComponentsReady', componentsReady, false); + + var script = document.createElement('script'); + script.async = true + script.src = './bundle.js'; + script.setAttribute('nomodule', true); + + var scriptModule = document.createElement('script'); + scriptModule.async = true + scriptModule.src = './module.bundle.js'; + scriptModule.setAttribute('module', true); + + + var refScript = document.body.getElementsByTagName('script')[0]; + refScript.parentNode.insertBefore(script, refScript); + }, false); diff --git a/webpack.config.js b/webpack.config.js index 107eeb6..a42070a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,6 +35,10 @@ const copyStatics = { from: resolve('./node_modules/@webcomponents/webcomponentsjs/webcomponents-sd-ce.js'), to: join(outputPath, 'vendor'), flatten: true + }, { + from: resolve('./node_modules/@webcomponents/webcomponentsjs/webcomponents-hi-sd-ce.js'), + to: join(outputPath, 'vendor'), + flatten: true }, { from: resolve('./node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'), to: join(outputPath, 'vendor'), From c28a6b639acd7e57f87a72aecca6ecab77524af6 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Wed, 29 Nov 2017 22:13:42 +0100 Subject: [PATCH 8/9] fixed type module, added script, removed inline script import --- src/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index aeb8577..7aa2375 100644 --- a/src/index.html +++ b/src/index.html @@ -82,11 +82,12 @@ var scriptModule = document.createElement('script'); scriptModule.async = true scriptModule.src = './module.bundle.js'; - scriptModule.setAttribute('module', true); + scriptModule.setAttribute('type', 'module'); var refScript = document.body.getElementsByTagName('script')[0]; refScript.parentNode.insertBefore(script, refScript); + refScript.parentNode.insertBefore(scriptModule, refScript); }, false); @@ -98,8 +99,6 @@ - - From 0e264d73c86fc3861249c136fe7a12f4f8dd0382 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Thu, 30 Nov 2017 20:30:31 +0100 Subject: [PATCH 9/9] chore(space): useless space --- src/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.html b/src/index.html index 7aa2375..e7365ea 100644 --- a/src/index.html +++ b/src/index.html @@ -84,7 +84,6 @@ scriptModule.src = './module.bundle.js'; scriptModule.setAttribute('type', 'module'); - var refScript = document.body.getElementsByTagName('script')[0]; refScript.parentNode.insertBefore(script, refScript); refScript.parentNode.insertBefore(scriptModule, refScript);