testing chunks
This commit is contained in:
parent
71132fe992
commit
191c38db8f
@ -3,71 +3,75 @@ const BundleTracker = require("webpack-bundle-tracker")
|
|||||||
const pages = {
|
const pages = {
|
||||||
recipe_search_view: {
|
recipe_search_view: {
|
||||||
entry: "./src/apps/RecipeSearchView/main.js",
|
entry: "./src/apps/RecipeSearchView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
recipe_view: {
|
recipe_view: {
|
||||||
entry: "./src/apps/RecipeView/main.js",
|
entry: "./src/apps/RecipeView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
offline_view: {
|
offline_view: {
|
||||||
entry: "./src/apps/OfflineView/main.js",
|
entry: "./src/apps/OfflineView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
import_view: {
|
import_view: {
|
||||||
entry: "./src/apps/ImportView/main.js",
|
entry: "./src/apps/ImportView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
import_response_view: {
|
import_response_view: {
|
||||||
entry: "./src/apps/ImportResponseView/main.js",
|
entry: "./src/apps/ImportResponseView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
export_response_view: {
|
export_response_view: {
|
||||||
entry: "./src/apps/ExportResponseView/main.js",
|
entry: "./src/apps/ExportResponseView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
export_view: {
|
export_view: {
|
||||||
entry: "./src/apps/ExportView/main.js",
|
entry: "./src/apps/ExportView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
supermarket_view: {
|
supermarket_view: {
|
||||||
entry: "./src/apps/SupermarketView/main.js",
|
entry: "./src/apps/SupermarketView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
model_list_view: {
|
model_list_view: {
|
||||||
entry: "./src/apps/ModelListView/main.js",
|
entry: "./src/apps/ModelListView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
edit_internal_recipe: {
|
edit_internal_recipe: {
|
||||||
entry: "./src/apps/RecipeEditView/main.js",
|
entry: "./src/apps/RecipeEditView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
cookbook_view: {
|
cookbook_view: {
|
||||||
entry: "./src/apps/CookbookView/main.js",
|
entry: "./src/apps/CookbookView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
meal_plan_view: {
|
meal_plan_view: {
|
||||||
entry: "./src/apps/MealPlanView/main.js",
|
entry: "./src/apps/MealPlanView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
ingredient_editor_view: {
|
ingredient_editor_view: {
|
||||||
entry: "./src/apps/IngredientEditorView/main.js",
|
entry: "./src/apps/IngredientEditorView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
shopping_list_view: {
|
shopping_list_view: {
|
||||||
entry: "./src/apps/ShoppingListView/main.js",
|
entry: "./src/apps/ShoppingListView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
space_manage_view: {
|
space_manage_view: {
|
||||||
entry: "./src/apps/SpaceManageView/main.js",
|
entry: "./src/apps/SpaceManageView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
profile_view: {
|
profile_view: {
|
||||||
entry: "./src/apps/ProfileView/main.js",
|
entry: "./src/apps/ProfileView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
},
|
},
|
||||||
settings_view: {
|
settings_view: {
|
||||||
entry: "./src/apps/SettingsView/main.js",
|
entry: "./src/apps/SettingsView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
|
},
|
||||||
|
test_view: {
|
||||||
|
entry: "./src/apps/TestView/main.js",
|
||||||
|
chunks: ["chunk-vendors","locales-chunk","api-chunk"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,6 +113,18 @@ module.exports = {
|
|||||||
config.optimization.splitChunks(
|
config.optimization.splitChunks(
|
||||||
{
|
{
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
|
locale: {
|
||||||
|
test: /[\\/]src[\\/]locales[\\/]/,
|
||||||
|
name: "locales-chunk",
|
||||||
|
chunks: "all",
|
||||||
|
priority: 3,
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
test: /[\\/]src[\\/]utils[\\/]openapi[\\/]/,
|
||||||
|
name: "api-chunk",
|
||||||
|
chunks: "all",
|
||||||
|
priority: 3,
|
||||||
|
},
|
||||||
vendor: {
|
vendor: {
|
||||||
test: /[\\/]node_modules[\\/]/,
|
test: /[\\/]node_modules[\\/]/,
|
||||||
name: "chunk-vendors",
|
name: "chunk-vendors",
|
||||||
@ -117,9 +133,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config.optimization.minimize(true)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config.optimization.minimize(true)
|
||||||
|
|
||||||
//TODO somehow remov them as they are also added to the manifest config of the service worker
|
//TODO somehow remov them as they are also added to the manifest config of the service worker
|
||||||
/*
|
/*
|
||||||
Object.keys(pages).forEach(page => {
|
Object.keys(pages).forEach(page => {
|
||||||
|
Loading…
Reference in New Issue
Block a user