TandoorRecipes/vue/vue.config.js
smilerz 9794d544cc Squashed commit of the following:
commit 7837467c30
Merge: aaaae5b1b 84759383f
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Sat Dec 18 23:14:24 2021 +0100

    Merge pull request #1146 from auanasgheps/patch-1

    Add documentation about swag by linuxserver

commit 84759383fa
Author: Oliver Cervera <cervera93-19@yahoo.it>
Date:   Sat Dec 18 13:49:09 2021 +0100

    Add documentation about swag by linuxserver

    Documents behaviour in #959

commit aaaae5b1ba
Merge: 4a747f5cd ea62c10d9
Author: vabene1111 <vabene1111@users.noreply.github.com>
Date:   Thu Dec 16 18:10:48 2021 +0100

    Merge pull request #1143 from smilerz/fix_get_facet_api

    fix bug in get_facet_api

commit ea62c10d9a
Author: smilerz <smilerz@gmail.com>
Date:   Thu Dec 16 09:20:56 2021 -0600

    remove console message

commit 3516505dd1
Author: smilerz <smilerz@gmail.com>
Date:   Thu Dec 16 09:08:32 2021 -0600

    fix bug in get_facet_api
2021-12-28 12:03:35 -06:00

118 lines
3.5 KiB
JavaScript

const BundleTracker = require("webpack-bundle-tracker")
const pages = {
recipe_search_view: {
entry: "./src/apps/RecipeSearchView/main.js",
chunks: ["chunk-vendors"],
},
recipe_view: {
entry: "./src/apps/RecipeView/main.js",
chunks: ["chunk-vendors"],
},
offline_view: {
entry: "./src/apps/OfflineView/main.js",
chunks: ["chunk-vendors"],
},
import_response_view: {
entry: "./src/apps/ImportResponseView/main.js",
chunks: ["chunk-vendors"],
},
supermarket_view: {
entry: "./src/apps/SupermarketView/main.js",
chunks: ["chunk-vendors"],
},
model_list_view: {
entry: "./src/apps/ModelListView/main.js",
chunks: ["chunk-vendors"],
},
edit_internal_recipe: {
entry: "./src/apps/RecipeEditView/main.js",
chunks: ["chunk-vendors"],
},
cookbook_view: {
entry: "./src/apps/CookbookView/main.js",
chunks: ["chunk-vendors"],
},
meal_plan_view: {
entry: "./src/apps/MealPlanView/main.js",
chunks: ["chunk-vendors"],
},
shopping_list_view: {
entry: "./src/apps/ShoppingListView/main.js",
chunks: ["chunk-vendors"],
},
}
module.exports = {
pages: pages,
filenameHashing: false,
productionSourceMap: false,
publicPath: process.env.NODE_ENV === "production" ? "" : "http://localhost:8080/",
outputDir: "../cookbook/static/vue/",
runtimeCompiler: true,
pwa: {
name: "Recipes",
themeColor: "#4DBA87",
msTileColor: "#000000",
appleMobileWebAppCapable: "yes",
appleMobileWebAppStatusBarStyle: "black",
workboxPluginMode: "InjectManifest",
workboxOptions: {
swSrc: "./src/sw.js",
swDest: "../../templates/sw.js",
manifestTransforms: [
(originalManifest) => {
const result = originalManifest.map((entry) => new Object({ url: "static/vue/" + entry.url }))
return { manifest: result, warnings: [] }
},
],
},
},
pluginOptions: {
i18n: {
locale: "en",
fallbackLocale: "en",
localeDir: "locales",
enableInSFC: true,
},
},
chainWebpack: (config) => {
config.optimization.splitChunks(
{
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "chunk-vendors",
chunks: "all",
priority: 1,
},
},
},
config.optimization.minimize(true)
)
//TODO somehow remov them as they are also added to the manifest config of the service worker
/*
Object.keys(pages).forEach(page => {
config.plugins.delete(`html-${page}`);
config.plugins.delete(`preload-${page}`);
config.plugins.delete(`prefetch-${page}`);
})
*/
config.plugin("BundleTracker").use(BundleTracker, [{ relativePath: true, path: "../vue/" }])
config.resolve.alias.set("__STATIC__", "static")
config.devServer
.public("http://localhost:8080")
.host("localhost")
.port(8080)
.hotOnly(true)
.watchOptions({ poll: 500 })
.https(false)
.headers({ "Access-Control-Allow-Origin": ["*"] })
},
}