From 7b73306622ef1ef7440e6ac88707d92fae8b97be Mon Sep 17 00:00:00 2001 From: David Rouyer Date: Sat, 2 Jun 2018 11:39:06 +0200 Subject: [PATCH 01/14] feat: webpack config improvements --- core/build/dev-server.js | 11 --- core/build/webpack.base.config.js | 10 +-- core/build/webpack.client.config.js | 99 +++--------------------- core/build/webpack.prod.client.config.js | 79 ++++++++++++++++++- package.json | 2 +- yarn.lock | 14 ++-- 6 files changed, 100 insertions(+), 115 deletions(-) diff --git a/core/build/dev-server.js b/core/build/dev-server.js index 4d8cc92044..eb957e6949 100644 --- a/core/build/dev-server.js +++ b/core/build/dev-server.js @@ -16,17 +16,6 @@ module.exports = function setupDevServer (app, cb) { let template // modify client config to work with hot middleware - - if(!clientConfig.hasOwnProperty('entry')) // multicompiler - { - for(let cc of clientConfig) - if(cc.hasOwnProperty('entry') && cc.entry.hasOwnProperty('app')) - { - clientConfig = cc; - break; - } - } - clientConfig.entry.app = ['webpack-hot-middleware/client', clientConfig.entry.app] clientConfig.output.filename = '[name].js' clientConfig.plugins.push( diff --git a/core/build/webpack.base.config.js b/core/build/webpack.base.config.js index adb98c0b4e..724514f386 100644 --- a/core/build/webpack.base.config.js +++ b/core/build/webpack.base.config.js @@ -36,6 +36,11 @@ module.exports = { app: './core/client-entry.js', vendor: ['vue', 'vue-router', 'vuex', 'vuex-router-sync'] }, + output: { + path: path.resolve(__dirname, '../../dist'), + publicPath: '/dist/', + filename: '[name].[hash].js' + }, resolveLoader: { modules: [ 'node_modules', @@ -85,11 +90,6 @@ module.exports = { 'theme/extensions': themeExtensions } }, - output: { - path: path.resolve(__dirname, '../../dist'), - publicPath: '/dist/', - filename: '[name].[hash].js' - }, module: { rules: [ { diff --git a/core/build/webpack.client.config.js b/core/build/webpack.client.config.js index ff4dc9af0d..445eb2cf02 100644 --- a/core/build/webpack.client.config.js +++ b/core/build/webpack.client.config.js @@ -2,13 +2,20 @@ const webpack = require('webpack') const merge = require('webpack-merge') const base = require('./webpack.base.config') const HTMLPlugin = require('html-webpack-plugin') -const SWPrecachePlugin = require('sw-precache-webpack-plugin') const path = require('path') const fs = require('fs') -const themeDirectory = require('./theme-path') -const themedIndex = path.join(themeDirectory, 'index.template.html') +const themeRoot = require('./theme-path') +const themedIndex = path.join(themeRoot, 'index.template.html') const config = merge(base, { + entry: { + 'service-worker-ext': themeRoot + '/service-worker-ext.js', + }, + output: { + path: path.resolve(__dirname, '../../dist'), + publicPath: '/dist/', + filename: '[name].js' + }, mode: 'development', resolve: { alias: { @@ -27,88 +34,4 @@ const config = merge(base, { ] }) -if (process.env.NODE_ENV === 'production') { - config.plugins.push( - // auto generate service worker - new SWPrecachePlugin({ - cacheId: 'vue-sfr', - filename: 'service-worker.js', - staticFileGlobsIgnorePatterns: [/\.map$/], - staticFileGlobs: [ - 'dist/**.*', - 'assets/**.*', - 'assets/ig/**.*', - 'index.html', - '/' - ], - runtimeCaching: [ - { - urlPattern: "^https://fonts\.googleapis\.com/", /** cache the html stub */ - handler: "cacheFirst" - }, - { - urlPattern: "^https://fonts\.gstatic\.com/", /** cache the html stub */ - handler: "cacheFirst" - }, - { - urlPattern: "^https://unpkg\.com/", /** cache the html stub */ - handler: "cacheFirst" - }, - { - urlPattern: "/pwa.html", /** cache the html stub */ - handler: "fastest" - },{ - urlPattern: "/", /** cache the html stub for homepage */ - handler: "fastest" - }, - { - urlPattern: "/p/*", /** cache the html stub */ - handler: "fastest" - }, - { - urlPattern: "/c/*", /** cache the html stub */ - handler: "fastest" - }, - { - urlPattern: "/img/(.*)", - handler: "fastest" - },{ - urlPattern: "/api/catalog/*", - handler: "fastest" - },{ - urlPattern: "/api/*", - handler: "networkFirst" - },{ - urlPattern: "/assets/logo.svg", - handler: "networkFirst" - },{ - urlPattern: "/index.html", - handler: "fastest" - },{ - urlPattern: "/assets/*", - handler: "fastest" - },{ - urlPattern: "/assets/ig/(.*)", - handler: "fastest" - },{ - urlPattern: "/dist/(.*)", - handler: "fastest" - }], - "importScripts": ['/service-worker-ext.js'] /* custom logic */ - }) - ) -} - -const configSW = merge({}, base); // this is basicaly a work-around to compile the service workers extensions as they are not included nowhere but in service worker only -const themeRoot = require('./theme-path') - -configSW.entry = { - 'service-worker-ext': themeRoot + '/service-worker-ext.js', -} -configSW.output = { - path: path.resolve(__dirname, '../../dist'), - publicPath: '/dist/', - filename: '[name].js' -}, - -module.exports = [config, configSW]; +module.exports = config; diff --git a/core/build/webpack.prod.client.config.js b/core/build/webpack.prod.client.config.js index f2581ec30d..b2f52de9f9 100644 --- a/core/build/webpack.prod.client.config.js +++ b/core/build/webpack.prod.client.config.js @@ -1,11 +1,84 @@ const path = require('path') +const themeRoot = require('./theme-path') +const merge = require('webpack-merge') +const extendedConfig = require(path.join(themeRoot, '/webpack.config.js')) +const SWPrecachePlugin = require('sw-precache-webpack-plugin') const baseClientConfig = require('./webpack.client.config') -const themeRoot = require('./theme-path') -const extendedConfig = require(path.join(themeRoot, '/webpack.config.js')) +const prodClientConfig = merge(baseClientConfig, { + plugins: [ + // auto generate service worker + new SWPrecachePlugin({ + cacheId: 'vue-sfr', + filename: 'service-worker.js', + staticFileGlobsIgnorePatterns: [/\.map$/], + staticFileGlobs: [ + 'dist/**.*', + 'assets/**.*', + 'assets/ig/**.*', + 'index.html', + '/' + ], + runtimeCaching: [ + { + urlPattern: "^https://fonts\.googleapis\.com/", /** cache the html stub */ + handler: "cacheFirst" + }, + { + urlPattern: "^https://fonts\.gstatic\.com/", /** cache the html stub */ + handler: "cacheFirst" + }, + { + urlPattern: "^https://unpkg\.com/", /** cache the html stub */ + handler: "cacheFirst" + }, + { + urlPattern: "/pwa.html", /** cache the html stub */ + handler: "fastest" + },{ + urlPattern: "/", /** cache the html stub for homepage */ + handler: "fastest" + }, + { + urlPattern: "/p/*", /** cache the html stub */ + handler: "fastest" + }, + { + urlPattern: "/c/*", /** cache the html stub */ + handler: "fastest" + }, + { + urlPattern: "/img/(.*)", + handler: "fastest" + },{ + urlPattern: "/api/catalog/*", + handler: "fastest" + },{ + urlPattern: "/api/*", + handler: "networkFirst" + },{ + urlPattern: "/assets/logo.svg", + handler: "networkFirst" + },{ + urlPattern: "/index.html", + handler: "fastest" + },{ + urlPattern: "/assets/*", + handler: "fastest" + },{ + urlPattern: "/assets/ig/(.*)", + handler: "fastest" + },{ + urlPattern: "/dist/(.*)", + handler: "fastest" + }], + "importScripts": ['/service-worker-ext.js'] /* custom logic */ + }) + ] +}) -module.exports = extendedConfig(baseClientConfig, { +module.exports = extendedConfig(prodClientConfig, { isClient: true, isDev: false }) diff --git a/package.json b/package.json index ac022a1952..a5d56df887 100755 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "karma-spec-reporter": "0.0.26", "karma-webpack": "^3.0.0", "lerna": "^2.9.0", - "markdown-to-vue-loader": "^0.4.0", + "markdown-to-vue-loader": "^0.5.0", "mocha": "^3.0.2", "node-sass": "^4.9.0", "phantomjs-prebuilt": "^2.1.10", diff --git a/yarn.lock b/yarn.lock index 37ad431440..178886c5a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6047,7 +6047,7 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -markdown-it@^8.4.0: +markdown-it@^8.4.1: version "8.4.1" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.1.tgz#206fe59b0e4e1b78a7c73250af9b34a4ad0aaf44" dependencies: @@ -6057,14 +6057,14 @@ markdown-it@^8.4.0: mdurl "^1.0.1" uc.micro "^1.0.5" -markdown-to-vue-loader@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/markdown-to-vue-loader/-/markdown-to-vue-loader-0.4.0.tgz#1a0c263a79a714d7dc4fcdfcbcf7b07969089224" +markdown-to-vue-loader@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/markdown-to-vue-loader/-/markdown-to-vue-loader-0.5.0.tgz#f6ed4444db15fa80693d654ad38673edcb61ce20" dependencies: cheerio "^1.0.0-rc.2" loader-utils "^1.1.0" - markdown-it "^8.4.0" - postcss "^6.0.14" + markdown-it "^8.4.1" + postcss "^6.0.22" marker-clusterer-plus@^2.1.4: version "2.1.4" @@ -7634,7 +7634,7 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 source-map "^0.5.6" supports-color "^3.2.3" -postcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.20: +postcss@^6.0.1, postcss@^6.0.20, postcss@^6.0.22: version "6.0.22" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.22.tgz#e23b78314905c3b90cbd61702121e7a78848f2a3" dependencies: From 671bda8304cbb24ec211cf6f91f93bfc80ea85ff Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 09:24:24 +0200 Subject: [PATCH 02/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fbb3ff49f..2081444229 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vue Storefront - headless PWA for eCommerce build:passed -![version](https://img.shields.io/badge/version-1.0%20RC-blue.svg) +![version](https://img.shields.io/badge/version-1.0-blue.svg) ![version](https://img.shields.io/badge/node-v8.x-blue.svg) ![Branch stable](https://img.shields.io/badge/stable%20branch-master-blue.svg) ![Branch Develop](https://img.shields.io/badge/dev%20branch-develop-blue.svg) From cdd678ec8c2e1e107d83185be25f26e617e1841f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Anio=C5=82?= <33483514+tom-aniol@users.noreply.github.com> Date: Wed, 6 Jun 2018 11:23:01 +0200 Subject: [PATCH 03/14] Update Readme.md - New Partners I've add Edmonds commerce, KT.Team, Vendic.nl --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2081444229..cc80ec5961 100644 --- a/README.md +++ b/README.md @@ -350,11 +350,11 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s > - - + + MageDirect @@ -387,6 +387,53 @@ Vue Storefront is a Community effort brought to You by our great Core Team and s + + + + MageDirect + + + + + Edmonds Commerce + + + + + KT Team + + + + + + + + + + + + + From d6ec62173d14bcf8d51418cec9aaffa721f00a1f Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:52:50 +0200 Subject: [PATCH 04/14] Update Working with plugins.md --- doc/plugins/Working with plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/plugins/Working with plugins.md b/doc/plugins/Working with plugins.md index 91e4e7fd51..f54c203242 100644 --- a/doc/plugins/Working with plugins.md +++ b/doc/plugins/Working with plugins.md @@ -14,5 +14,5 @@ To add new core plugin you have to create new file `core/plugins/{plugin-name}/i ## Theme plugins -Theme plugins should be located in `src/themes/{theme_name}/plugins`. To add new theme plugin you have to create new file `plugins/{plugin-name}/index.js` in theme scope and write there plugin code. If you want to register it just add it to `plugins/index.js` in theme scope as well. +It's a best practice to lcoate all theme plugins in `src/themes/{theme_name}/plugins`. To add new theme plugin you have to create new file `plugins/{plugin-name}/index.js` in theme scope and write there plugin code. If you want to register it just add it to `plugins/index.js` in theme scope as well. From b6699d93ad41f9fcc5b26cc883a5ee67104ced73 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:53:21 +0200 Subject: [PATCH 05/14] Delete Working with plugins.md --- doc/plugins/Working with plugins.md | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 doc/plugins/Working with plugins.md diff --git a/doc/plugins/Working with plugins.md b/doc/plugins/Working with plugins.md deleted file mode 100644 index f54c203242..0000000000 --- a/doc/plugins/Working with plugins.md +++ /dev/null @@ -1,18 +0,0 @@ -# Working with plugins - -Plugins usually add global-level functionality to Vue. In Vue Storefront there are two types of plugins. - - -## Core plugins - -Core plugins are located in `core/plugins` folder. There are two core plugins: - -* Config - it allows global access to config file (available via `$this.$config`), -* Event Bus - it allows global event bus for the project (available via `$this.$bus`). - -To add new core plugin you have to create new file `core/plugins/{plugin-name}/index.js` and write there plugin code. If you want to register it just add it to `core/plugins/index.js`. - -## Theme plugins - -It's a best practice to lcoate all theme plugins in `src/themes/{theme_name}/plugins`. To add new theme plugin you have to create new file `plugins/{plugin-name}/index.js` in theme scope and write there plugin code. If you want to register it just add it to `plugins/index.js` in theme scope as well. - From 9350ceb4471e42c696887a2ff19820f38971193e Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:56:47 +0200 Subject: [PATCH 06/14] Update Working with plugins.md --- doc/Working with plugins.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/doc/Working with plugins.md b/doc/Working with plugins.md index cb8cce55bc..9c64e95b14 100644 --- a/doc/Working with plugins.md +++ b/doc/Working with plugins.md @@ -27,18 +27,14 @@ Currently there are two core plugins: ## Theme plugins -Theme plugins works exactly like core plugins and are merged with them during webpack build process. - -If you want to add new 3rd party plugin (e.g Vuetify) you need to export it in `src/{theme}/plugins/index.js` so it will be proceeded with `Vue.use()` in `core/app.js` file. Here is an example of Vuetify registration in `core/plugins/index.js` file: +It's a good practice to register theme plugins under `{theme}/plugins` folder. ````js import Vuetify from 'vuetify' // import other plugins -export { - Vuetify - // other plugins -} +Vue.use(Vuetify) +// other plugins ```` If you want to make custom plugin for your theme create a directory for it in 'src/{theme}/plugins' (eg. `src/{theme}/plugins/custom_plugin`) and register it in `src/{theme}/plugins/index.js` like a 3rd party plugin in example above. From c103dcf6cc4a5bb321a4c430240c38c31bc8981d Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:57:24 +0200 Subject: [PATCH 07/14] Create 1.0-1.1.md --- doc/changes/1.0-1.1.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/changes/1.0-1.1.md diff --git a/doc/changes/1.0-1.1.md b/doc/changes/1.0-1.1.md new file mode 100644 index 0000000000..c2da4b53bc --- /dev/null +++ b/doc/changes/1.0-1.1.md @@ -0,0 +1,5 @@ +# 1.0 -> 1.1 change list + +## Plugins registration simplified + +Instead of exporting an object in `{theme}/plugins/index.js' just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) From 14eec673f5a6d060864a930144c0e4fe4ff4a962 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:58:02 +0200 Subject: [PATCH 08/14] Update 1.0-1.1.md --- doc/changes/1.0-1.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes/1.0-1.1.md b/doc/changes/1.0-1.1.md index c2da4b53bc..f1e6802833 100644 --- a/doc/changes/1.0-1.1.md +++ b/doc/changes/1.0-1.1.md @@ -2,4 +2,4 @@ ## Plugins registration simplified -Instead of exporting an object in `{theme}/plugins/index.js' just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) +Instead of exporting an object in `{theme}/plugins/index.js` just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) From 772cb1e303e92791233e36ad295f5216d465a472 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 11:59:45 +0200 Subject: [PATCH 09/14] Update 1.0-1.1.md --- doc/changes/1.0-1.1.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/changes/1.0-1.1.md b/doc/changes/1.0-1.1.md index f1e6802833..526c4dc5d5 100644 --- a/doc/changes/1.0-1.1.md +++ b/doc/changes/1.0-1.1.md @@ -1,5 +1,11 @@ # 1.0 -> 1.1 change list +# Modifications + ## Plugins registration simplified Instead of exporting an object in `{theme}/plugins/index.js` just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) + +# New features + +We added [`vue-progressbar`](https://github.com/hilongjw/vue-progressbar) to default theme which can be found in `App.vue` file From 88c89e28ae7f42114a78eafe5ecafdbd2de1a192 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 12:08:02 +0200 Subject: [PATCH 10/14] Delete 1.0-1.1.md --- doc/changes/1.0-1.1.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 doc/changes/1.0-1.1.md diff --git a/doc/changes/1.0-1.1.md b/doc/changes/1.0-1.1.md deleted file mode 100644 index 526c4dc5d5..0000000000 --- a/doc/changes/1.0-1.1.md +++ /dev/null @@ -1,11 +0,0 @@ -# 1.0 -> 1.1 change list - -# Modifications - -## Plugins registration simplified - -Instead of exporting an object in `{theme}/plugins/index.js` just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) - -# New features - -We added [`vue-progressbar`](https://github.com/hilongjw/vue-progressbar) to default theme which can be found in `App.vue` file From b9664478d11845ecef156b00b7460e708818b743 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 12:08:56 +0200 Subject: [PATCH 11/14] Update Upgrade notes.md --- doc/Upgrade notes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/Upgrade notes.md b/doc/Upgrade notes.md index 7c6d98bed8..f342eca4c3 100644 --- a/doc/Upgrade notes.md +++ b/doc/Upgrade notes.md @@ -2,6 +2,18 @@ We're trying to keep the upgrade process as easy as it's possible. Unfortunately sometimes manual code changes are required. Before pulling out the latest version, please take a look at the upgrade notes below:. +## 1.0 -> 1.1 (currently on develop branch) + +### Modifications + +#### Plugins registration simplified + +Instead of exporting an object in `{theme}/plugins/index.js` just use `Vue.use(pugin)` directly in this file ( [docs](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) ) + +### New features + +We added [`vue-progressbar`](https://github.com/hilongjw/vue-progressbar) to default theme which can be found in `App.vue` file + ## 1.0RC-3 -> 1.0([release notes](https://github.com/DivanteLtd/vue-storefront/releases/tag/v1.0.0)) This is official, stable release of Vue Storefront. From 0c7013282c133eb858f0fd06594f05269bd1bb67 Mon Sep 17 00:00:00 2001 From: Filip Rakowski Date: Wed, 6 Jun 2018 13:51:34 +0200 Subject: [PATCH 12/14] Update Working with themes.md --- doc/themes/Working with themes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/themes/Working with themes.md b/doc/themes/Working with themes.md index 5e40dc0023..8fca203f15 100644 --- a/doc/themes/Working with themes.md +++ b/doc/themes/Working with themes.md @@ -33,12 +33,13 @@ Below you can find the list of files that are essential for your theme to work: * `pages` - your shop pages * `plugins` - theme-specific plugins (extends `core/plugins`, see [Working with plugins](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20plugins.md) * `resource` - theme-specific resources (extends `core/resorce`) +* `router` - theme router * `store` - theme-specific stores (extends `core/store`) * `ui-store.js` - here you can extend core `ui-store` * `index.js` - here you can register theme-specific stores * `app-extend.js` - The code inside this file will be executed in app's entry file just after registering core plugins, filters and mixins. It takes app's Vue instance as a param so you can make use of it. (extends `core/app.js`) * `App.vue` - theme's entry component -* `index.js` - theme's routes +* `index.js` - theme initialization * `package.json` - theme-specific dependencies * `service-worker-ext.js` - you can extend core service worker here (see [Working with Service Workers](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20service-worker.md) * `webpack.config.js` - you can extend core webpack build in this file (extends `core/build/`, see [Working with webpack](https://github.com/DivanteLtd/vue-storefront/blob/master/doc/Working%20with%20webpack.md)) From 5b4fb47f770ab96d276b5c51e272d49f8da8e80d Mon Sep 17 00:00:00 2001 From: Piotr Karwatka Date: Fri, 8 Jun 2018 14:09:44 +0200 Subject: [PATCH 13/14] Update FAQ and Receipes.md --- doc/FAQ and Receipes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/FAQ and Receipes.md b/doc/FAQ and Receipes.md index 00614da002..64b7512b24 100644 --- a/doc/FAQ and Receipes.md +++ b/doc/FAQ and Receipes.md @@ -21,6 +21,7 @@ If you solved any new issues by yourself please let us know on [slack](http://vu * How to add/remove/change field types in the ElasticSearch index * How to integrate 3rd party Magento extensions? * How to support Multistore / Multiwebsite setup +* How to deal with Category filters based on configurable_children ### Problem starting docker while installing the vue-storefront @@ -218,3 +219,7 @@ If the extensions are not playing with the User Interface, probably they will wo Currently, the Multi Website support is possible by setting up few separate instances of Vue Storefront configured to use other API endpoints + have few ElasticSearch indexes (each for one storeView). Magento2 API allows the user to simply add the: http://magento-store.example.com/store_code/V1 ... to the endpoitns so You can just switch the store view by changing store_code - from "default" to any kind of "en", "de" ... 2 +### How to deal with Category filters based on configurable_children + +If You like to have Category filter working with configurable products - You need to expand the `product.configurable_children.attrName` to `product.attrName_options` array. This is automatically done by [mage2vuestorefront](https://github.com/DivanteLtd/mage2vuestorefront) for all attributes set as `product.configurable_options` (by default: color, size). If You like to add additional fields like `manufacturer` to the filters You need to expand `product.manufacturer_options` field. The easiest way to do so is to set `config.product.expandConfigurableFilters` to `['manufacturer']` and re-run the `mage2vuestorefront` indexer. + From 5fc46491cf07ec33d96582e808d6a3e1533ca0f7 Mon Sep 17 00:00:00 2001 From: David Rouyer Date: Wed, 13 Jun 2018 20:58:23 +0200 Subject: [PATCH 14/14] chore: fix build --- core/build/webpack.base.config.js | 2 -- core/build/webpack.prod.client.config.js | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/build/webpack.base.config.js b/core/build/webpack.base.config.js index 724514f386..53e1e83db5 100644 --- a/core/build/webpack.base.config.js +++ b/core/build/webpack.base.config.js @@ -9,8 +9,6 @@ fs.writeFileSync( JSON.stringify(config) ) -const appConfig = require('./config.json') - const extensionsRoot = '../../src/extensions' const themesRoot = '../../src/themes' diff --git a/core/build/webpack.prod.client.config.js b/core/build/webpack.prod.client.config.js index b2f52de9f9..2988eb7105 100644 --- a/core/build/webpack.prod.client.config.js +++ b/core/build/webpack.prod.client.config.js @@ -1,11 +1,10 @@ const path = require('path') -const themeRoot = require('./theme-path') const merge = require('webpack-merge') +const baseClientConfig = require('./webpack.client.config') +const themeRoot = require('./theme-path') const extendedConfig = require(path.join(themeRoot, '/webpack.config.js')) const SWPrecachePlugin = require('sw-precache-webpack-plugin') -const baseClientConfig = require('./webpack.client.config') - const prodClientConfig = merge(baseClientConfig, { plugins: [ // auto generate service worker