Skip to content

Commit 0d74753

Browse files
baffoo7pb
andauthored
feat: transform hardcoded 'assets/static/' path to an options parameter (#54)
Co-authored-by: Primož Bevk <[email protected]>
1 parent c59c9d4 commit 0d74753

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

gridsome.client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const clientConfig = function (Vue, options, context) {
3030
})
3131
}
3232

33-
const iconsDir = 'assets/static/';
33+
const iconsDir = options.staticAssetsDir;
3434
const iconPathParsed = parse(options.icon);
3535
const msTileImage = `/${iconsDir}${iconPathParsed.name}-144x144${iconPathParsed.ext}`;
3636

src/files/manifest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import rename from 'rename'
55

66
export const createManifest = async (context, config, queue, options) => {
77
const manifestDest = path.join(config.outputDir, options.manifestPath);
8-
const iconsDir = path.join(config.outputDir, 'assets/static/');
8+
const iconsDir = path.join(config.outputDir, options.staticAssetsDir);
99
const iconName = options.icon.split('/').slice(-1)[0];
1010

1111
// Generate all size images from options.icon

src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function Plugin(api, options) {
2828
title: options.title,
2929
serviceWorkerPath: path.join(pathPrefix, options.serviceWorkerPath),
3030
manifestPath: path.join(pathPrefix, options.manifestPath),
31+
staticAssetsDir: options.staticAssetsDir,
3132
statusBarStyle: options.statusBarStyle,
3233
themeColor: options.themeColor,
3334
icon: options.icon,
@@ -44,6 +45,7 @@ Plugin.defaultOptions = () => ({
4445
display: "standalone",
4546
statusBarStyle: "default",
4647
manifestPath: "manifest.json",
48+
staticAssetsDir: "assets/static/",
4749
disableServiceWorker: false,
4850
serviceWorkerPath: "service-worker.js",
4951
cachedFileTypes: "js,json,css,html,png,jpg,jpeg,svg,gif",

0 commit comments

Comments
 (0)