diff --git a/example/basic/webpack.config.js b/example/basic/webpack.config.js index b4709f85..743b551d 100644 --- a/example/basic/webpack.config.js +++ b/example/basic/webpack.config.js @@ -10,8 +10,7 @@ module.exports = (env, args) => { entry: './src/app.js', output: { path: resolve(__dirname, 'public'), - publicPath: '/', - filename: 'app.js' + filename: 'app.js', }, plugins: [ new HtmlWebpackPlugin({ diff --git a/package-lock.json b/package-lock.json index daaf5f71..5464e7a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "favicons-webpack-plugin", - "version": "5.0.0-alpha.5", + "version": "5.0.0-alpha.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2494,9 +2494,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001176", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001176.tgz", - "integrity": "sha512-VWdkYmqdkDLRe0lvfJlZQ43rnjKqIGKHWhWWRbkqMsJIUaYDNf/K/sdZZcVO6YKQklubokdkJY+ujArsuJ5cag==", + "version": "1.0.30001178", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001178.tgz", + "integrity": "sha512-VtdZLC0vsXykKni8Uztx45xynytOi71Ufx9T8kHptSw9AL4dpqailUJJHavttuzUe1KYuBYtChiWv+BAb7mPmQ==", "dev": true }, "caseless": { @@ -4907,9 +4907,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.637", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.637.tgz", - "integrity": "sha512-924WXYMYquYybc+7pNApGlhY2RWg3MY3he4BrZ5BUmM2n1MGBsrS+PZxrlo6UAsWuNl4NE66fqFdwsWkBUGgkA==", + "version": "1.3.642", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.642.tgz", + "integrity": "sha512-cev+jOrz/Zm1i+Yh334Hed6lQVOkkemk2wRozfMF4MtTR7pxf3r3L5Rbd7uX1zMcEqVJ7alJBnJL7+JffkC6FQ==", "dev": true }, "emittery": { @@ -4955,9 +4955,9 @@ } }, "enhanced-resolve": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.6.0.tgz", - "integrity": "sha512-C3GGDfFZmqUa21o10YRKbZN60DPl0HyXKXxoEnQMWso9u7KMU23L7CBHfr/rVxORddY/8YQZaU2MZ1ewTS8Pcw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz", + "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -5028,6 +5028,12 @@ "string.prototype.trimstart": "^1.0.1" } }, + "es-module-lexer": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", + "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", + "dev": true + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -7429,9 +7435,9 @@ } }, "html-webpack-plugin": { - "version": "5.0.0-beta.4", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.0.0-beta.4.tgz", - "integrity": "sha512-4CWq246BVHfS2l8Ni68q/oWquwJuaHs5s2Z+yVCmKNWadxS28RAqZo98hMtpnTLwhbhIg04psduDMcUr9JJpXg==", + "version": "5.0.0-beta.6", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.0.0-beta.6.tgz", + "integrity": "sha512-wjdhOnJlo5c8uN3OahRm2eaLKL8gEQ4ZNOkwQc8BStyudpFLTsg28m6wbf00keXiRPesk2Pad9CYeKpxbffApg==", "dev": true, "optional": true, "requires": { @@ -9285,9 +9291,9 @@ } }, "node-releases": { - "version": "1.1.69", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.69.tgz", - "integrity": "sha512-DGIjo79VDEyAnRlfSqYTsy+yoHd2IOjJiKUozD2MV2D85Vso6Bug56mb9tT/fY5Urt0iqk01H7x+llAruDR2zA==", + "version": "1.1.70", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.70.tgz", + "integrity": "sha512-Slf2s69+2/uAD79pVVQo8uSiC34+g8GWY8UH2Qtqv34ZfhYrxpYpfzs9Js9d6O0mbDmALuxaTlplnBTnSELcrw==", "dev": true }, "noop-logger": { @@ -12805,9 +12811,9 @@ } }, "webpack": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.13.0.tgz", - "integrity": "sha512-NPhMEtfhSVegp1FNPkCM1MPygDm0GHwpreG10dh//0Gr0epfB0br9nlgEfxSghxJqrQ7j9XzgO91CGGLWZiHeA==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.16.0.tgz", + "integrity": "sha512-QOkctcjYfEGxcYg4AzPJafyAQ7ANc266/URkX881uFA7b2k31E0Dmpy1ExfppHOTp1kHDTsRh9sXojVUvgPF0g==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -12818,7 +12824,8 @@ "acorn": "^8.0.4", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.6.0", + "enhanced-resolve": "^5.7.0", + "es-module-lexer": "^0.3.26", "eslint-scope": "^5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", diff --git a/package.json b/package.json index df0598c4..18424909 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "favicons-webpack-plugin", - "version": "5.0.0-alpha.6", + "version": "5.0.0-alpha.7", "description": "Let webpack generate all your favicons and icons for you", "main": "src/index.js", "files": [ @@ -53,13 +53,13 @@ "favicons": "^6.2.0", "fs-extra": "^8.1.0", "get-folder-size": "2.0.1", - "html-webpack-plugin": "^5.0.0-beta.4", + "html-webpack-plugin": "^5.0.0-beta.6", "image-size": "0.8.3", "nyc": "^15.0.0", "prettier": "1.19.1", "standard-version": "8.0.2", "typescript": "3.7.4", - "webpack": "^5.13.0", + "webpack": "^5.16.0", "webpack-cli": "4.3.1", "webpack-dev-server": "3.11.1", "webpack-merge": "^4.2.2" @@ -79,7 +79,7 @@ "favicons": ">= 6.2.0" }, "optionalDependencies": { - "html-webpack-plugin": ">=5.0.0 || ^5.0.0-beta.3" + "html-webpack-plugin": ">=5.0.0 || ^5.0.0-beta.6" }, "config": { "commitizen": { diff --git a/src/cache.js b/src/cache.js index 2ae9cdc3..a3a782e2 100644 --- a/src/cache.js +++ b/src/cache.js @@ -1,11 +1,12 @@ -/// @ts-check +// / @ts-check // Import types /** @typedef {ReturnType} WebpackCacheFacade */ /** @typedef {import("webpack").Compilation} WebpackCompilation */ -/** @typedef {any} Snapshot */ +/** @typedef {Parameters[0]} Snapshot */ -/** @typedef {{ +/** @typedef {{, + publicPath: string, tags: string[], assets: Array<{ name: string, @@ -22,7 +23,7 @@ const { /** @type {WeakMap>} */ const snapshots = new WeakMap(); -/** @type {WeakMap>} */ +/** @type {WeakMap, Promise>} */ const faviconCache = new WeakMap(); /** @@ -61,6 +62,7 @@ function runCached( // and try again if (!isValid) { faviconCache.delete(latestSnapShot); + return runCached( faviconOptions, context, @@ -69,6 +71,7 @@ function runCached( generator ); } + // If the cache is valid return the result directly from cache return cachedFavicons; }); @@ -76,17 +79,15 @@ function runCached( // Store a snapshot of the filesystem // to find out if the logo was changed - snapshots.set( - pluginInstance, - createSnapshot( - { - fileDependencies: [logo], - contextDependencies: [], - missingDependencies: [] - }, - compilation - ) + const newSnapShot = createSnapshot( + { + fileDependencies: [logo], + contextDependencies: [], + missingDependencies: [] + }, + compilation ); + snapshots.set(pluginInstance, newSnapShot); // Start generating the favicons const faviconsGenerationsPromise = runWithFileCache( @@ -97,10 +98,7 @@ function runCached( ); // Store the promise of the favicon compilation in cache - faviconCache.set( - snapshots.get(pluginInstance) || latestSnapShot, - faviconsGenerationsPromise - ); + faviconCache.set(newSnapShot, faviconsGenerationsPromise); return faviconsGenerationsPromise; } @@ -120,8 +118,8 @@ function createSnapshot(fileDependencies, mainCompilation) { fileDependencies.missingDependencies, {}, (err, snapshot) => { - if (err) { - return reject(err); + if (err || !snapshot) { + return reject(err || new Error('Could not create Snapshot')); } resolve(snapshot); } @@ -165,7 +163,10 @@ async function runWithFileCache( ) ); - const compilationOutputPath = compilation.outputOptions.path || ''; + const compilationOutputPath = + compilation.outputOptions.path === 'auto' + ? '' + : compilation.outputOptions.path || ''; /** * the relative output path to the folder where the favicon files should be generated to * it might include tokens like [fullhash] or [contenthash] @@ -184,16 +185,19 @@ async function runWithFileCache( relativeOutputPath, logoContentHash ); + const webpackPublicPath = + compilation.outputOptions.publicPath === 'auto' + ? '' + : compilation.outputOptions.publicPath; const resolvedPublicPath = replaceContentHash( compilation, resolvePublicPath( compilation, - faviconOptions.publicPath || compilation.outputOptions.publicPath, + faviconOptions.publicPath || webpackPublicPath, faviconOptions.prefix ), logoContentHash ); - return generator(logoSource, compilation, resolvedPublicPath, outputPath); }; @@ -211,6 +215,7 @@ async function runWithFileCache( // Recompile filesystem cache if the logo source changes: logoContentHash ].join('\n'); + // Use the webpack cache which supports filesystem caching to improve build speed // See also https://webpack.js.org/configuration/other-options/#cache // Create one cache for every output target diff --git a/src/hash.js b/src/hash.js index 9324f8ff..74bf28a3 100644 --- a/src/hash.js +++ b/src/hash.js @@ -1,4 +1,4 @@ -/// @ts-check +// / @ts-check // Import types /** @typedef {import("webpack").Compilation} WebpackCompilation */ @@ -16,16 +16,14 @@ const url = require('url'); function resolvePublicPath(compilation, publicPath, assetPath) { const publicPathString = publicPath && typeof publicPath === 'function' - ? compilation.getAssetPath( - compilation.outputOptions.publicPath || 'auto', - { hash: compilation.hash } - ) + ? compilation.getAssetPath(publicPath, { hash: compilation.hash }) : publicPath; const fullAssetPath = url.resolve( - appendSlash(publicPathString || 'auto'), + appendSlash(publicPathString || ''), assetPath ); + return fullAssetPath; } @@ -52,7 +50,7 @@ function replaceContentHash(compilation, assetPath, hash) { * @param {string} url */ function appendSlash(url) { - return url && url.length && url.substr(-1, 1) !== '/' ? url + '/' : url; + return url && url.length && url.substr(-1, 1) !== '/' ? `${url}/` : url; } /** diff --git a/src/index.js b/src/index.js index 14088226..e08b584b 100644 --- a/src/index.js +++ b/src/index.js @@ -5,6 +5,7 @@ const parse5 = require('parse5'); const path = require('path'); const { runCached } = require('./cache'); const Oracle = require('./oracle'); +const url = require('url'); /** @type {WeakMap}>>} */ const faviconCompilations = new WeakMap(); @@ -107,11 +108,12 @@ class FaviconsWebpackPlugin { if (HtmlWebpackPlugin && this.options.inject) { if (!verifyHtmlWebpackPluginVersion(HtmlWebpackPlugin)) { compilation.errors.push( - new Error( + new compiler.webpack.WebpackError( `${'FaviconsWebpackPlugin - This FaviconsWebpackPlugin version is not compatible with your current HtmlWebpackPlugin version.\n' + 'Please upgrade to HtmlWebpackPlugin >= 5 OR downgrade to FaviconsWebpackPlugin 2.x\n'}${getHtmlWebpackPluginVersion()}` ) ); + return; } HtmlWebpackPlugin.getHooks(compilation).alterAssetTags.tapAsync( @@ -132,18 +134,60 @@ class FaviconsWebpackPlugin { faviconCompilation .then(faviconCompilation => { + // faviconCompilation.publicPath and htmlPluginData.publicPath can be: + // absolute: http://somewhere.com/app1/ + // absolute: /demo/app1/ + // relative: my/app/ + const publicPathFromHtml = url.resolve( + htmlPluginData.publicPath, + faviconCompilation.publicPath + ); + + // Prefix links to icons + const pathReplacer = + !this.options.favicons.path || + this.getCurrentCompilationMode(compiler) === 'light' + ? /** @param {string} url */ url => + typeof url === 'string' + ? publicPathFromHtml + url + : url + : /** @param {string} url */ url => url; + htmlPluginData.assetTags.meta.push( ...faviconCompilation.tags .map(tag => parse5.parseFragment(tag).childNodes[0]) - .map(({ tagName, attrs }) => ({ - tagName, - voidTag: true, - attributes: attrs.reduce( - (obj, { name, value }) => - Object.assign(obj, { [name]: value }), - {} - ) - })) + .map(({ tagName, attrs }) => { + const htmlTag = { + tagName, + voidTag: true, + meta: { plugin: 'favicons-webpack-plugin' }, + attributes: attrs.reduce( + (obj, { name, value }) => + Object.assign(obj, { [name]: value }), + {} + ) + }; + // Prefix link tags + if (typeof htmlTag.attributes.href === 'string') { + htmlTag.attributes.href = pathReplacer( + htmlTag.attributes.href + ); + } + // Prefix meta tags + if ( + htmlTag.tagName === 'meta' && + [ + 'msapplication-TileImage', + 'msapplication-config' + ].includes(htmlTag.attributes.name) + ) { + htmlTag.attributes.content = pathReplacer( + htmlTag.attributes.content + ); + } + + return htmlTag; + }) ); htmlWebpackPluginCallback(null, htmlPluginData); @@ -207,6 +251,7 @@ class FaviconsWebpackPlugin { 'favicons-webpack-plugin - generate only a single favicon for fast compilation time in development mode. This behaviour can be changed by setting the favicon mode option.' ); } + return this.generateFaviconsLight( logoSource, compilation, @@ -241,18 +286,18 @@ class FaviconsWebpackPlugin { outputPath ) { const faviconExt = path.extname(this.options.logo); - const faviconName = '/favicon' + faviconExt; + const faviconName = `favicon${faviconExt}`; const RawSource = compilation.compiler.webpack.sources.RawSource; + return { + publicPath: resolvedPublicPath, assets: [ { name: path.join(outputPath, faviconName), contents: new RawSource(logoSource, false) } ], - tags: [ - `` - ] + tags: [``] }; } @@ -275,17 +320,19 @@ class FaviconsWebpackPlugin { const RawSource = compilation.compiler.webpack.sources.RawSource; const favicons = loadFaviconsLibrary(); // Generate favicons using the npm favicons library - const { html: tags, images, files } = await favicons( - logoSource, - Object.assign({}, this.options.favicons, { - path: resolvedPublicPath - }) - ); + const { html: tags, images, files } = await favicons(logoSource, { + // Generate all assets relative to the root directory + // to allow relative manifests and to set the final public path + // once it has been provided by the html-webpack-plugin + path: '', + ...this.options.favicons + }); const assets = [...images, ...files].map(({ name, contents }) => ({ name: outputPath ? path.join(outputPath, name) : name, contents: new RawSource(contents, false) })); - return { assets, tags }; + + return { assets, tags, publicPath: resolvedPublicPath }; } /** @@ -336,8 +383,9 @@ function loadFaviconsLibrary() { return require('favicons'); } catch (e) { throw new Error( - 'Could not find the npm peerDependency "favicons".\nPlease run:\nnpm i favicons\n - or -\nyarn add favicons\n\n' + - String(e) + `Could not find the npm peerDependency "favicons".\nPlease run:\nnpm i favicons\n - or -\nyarn add favicons\n\n${String( + e + )}` ); } } diff --git a/src/options.d.ts b/src/options.d.ts index ce8096fc..c351818e 100644 --- a/src/options.d.ts +++ b/src/options.d.ts @@ -48,6 +48,12 @@ export interface FaviconWebpackPlugionOptions { * by default this mode is used for production */ devMode?: 'light' | 'webapp', + /** + * Web app manifests are part of a collection of web technologies called progressive web apps (PWAs), + * which are websites that can be installed to a device’s homescreen without an app store. + * @see https://developer.mozilla.org/en-US/docs/Web/Manifest + */ + manifest?: string | (() => void) /** * Prefix path for generated assets */ diff --git a/test/light.test.js b/test/light.test.js index 5d96c388..b2076d74 100644 --- a/test/light.test.js +++ b/test/light.test.js @@ -13,7 +13,8 @@ test('should work if manual set to light mode', async t => { const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), @@ -30,7 +31,8 @@ test('should automatically pick up the dev mode from webpack', async t => { mode: 'development', context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo })] }); diff --git a/test/prefixed.test.js b/test/prefixed.test.js index 194d0d04..0ee5fcce 100644 --- a/test/prefixed.test.js +++ b/test/prefixed.test.js @@ -13,13 +13,14 @@ test('should allow configuring the output prefix', async t => { const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo, - prefix: 'custom/prefix/[contenthash:8]' + prefix: 'custom/prefix/[contenthash:8]/' }) ] }); @@ -32,13 +33,14 @@ test('should allow configuring the output prefix for light mode', async t => { const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo, - prefix: 'custom/prefix/[contenthash:8]', + prefix: 'custom/prefix/[contenthash:8]/', mode: 'light' }) ] @@ -52,13 +54,14 @@ test('should allow configuring the output prefix with a fullhash', async t => { const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo, - prefix: 'custom/prefix/[fullhash:8]' + prefix: 'custom/prefix/[fullhash:8]/' }) ] }); @@ -71,13 +74,14 @@ test('should allow configuring the output prefix for light mode with a fullhash' const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo, - prefix: 'custom/prefix/[fullhash:8]', + prefix: 'custom/prefix/[fullhash:8]/', mode: 'light' }) ] diff --git a/test/publicpath.test.js b/test/publicpath.test.js index e5f5e42b..d9dbecd3 100644 --- a/test/publicpath.test.js +++ b/test/publicpath.test.js @@ -16,7 +16,42 @@ test('should take the public path into account', async t => { path: dist, publicPath: '/public/path' }, - plugins: [new HtmlWebpackPlugin(), new FaviconsWebpackPlugin({ logo })] + plugins: [ + new HtmlWebpackPlugin(), + new FaviconsWebpackPlugin({ logo, mode: 'webapp' }) + ] + }); + + snapshotCompilationAssets(t, compilationStats); +}); + +test('should work with an empty public path', async t => { + const dist = path.join(t.context.root, 'dist'); + const compilationStats = await generate({ + context: t.context.root, + output: { + path: dist + }, + plugins: [ + new HtmlWebpackPlugin(), + new FaviconsWebpackPlugin({ logo, mode: 'webapp' }) + ] + }); + + snapshotCompilationAssets(t, compilationStats); +}); + +test('should work with an empty public path and a nested html file', async t => { + const dist = path.join(t.context.root, 'dist'); + const compilationStats = await generate({ + context: t.context.root, + output: { + path: dist + }, + plugins: [ + new HtmlWebpackPlugin({ filename: 'demo/index.html' }), + new FaviconsWebpackPlugin({ logo, mode: 'webapp' }) + ] }); snapshotCompilationAssets(t, compilationStats); diff --git a/test/publicpathLight.test.js b/test/publicpathLight.test.js new file mode 100644 index 00000000..a41136be --- /dev/null +++ b/test/publicpathLight.test.js @@ -0,0 +1,60 @@ +const test = require('ava'); +const path = require('path'); +const fs = require('fs-extra'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const FaviconsWebpackPlugin = require('../'); + +const { logo, generate, mkdir, snapshotCompilationAssets } = require('./util'); + +test.beforeEach(async t => (t.context.root = await mkdir())); + +test('should take the public path into account', async t => { + const dist = path.join(t.context.root, 'dist'); + const compilationStats = await generate({ + context: t.context.root, + output: { + path: dist, + publicPath: '/public/path' + }, + plugins: [ + new HtmlWebpackPlugin(), + new FaviconsWebpackPlugin({ logo, mode: 'light' }) + ] + }); + + snapshotCompilationAssets(t, compilationStats); +}); + +test('should work with an empty public path', async t => { + const dist = path.join(t.context.root, 'dist'); + const compilationStats = await generate({ + context: t.context.root, + output: { + path: dist + }, + plugins: [ + new HtmlWebpackPlugin(), + new FaviconsWebpackPlugin({ logo, mode: 'light' }) + ] + }); + + snapshotCompilationAssets(t, compilationStats); +}); + +test('should work with an empty public path and a nested html file', async t => { + const dist = path.join(t.context.root, 'dist'); + const compilationStats = await generate({ + context: t.context.root, + output: { + path: dist + }, + plugins: [ + new HtmlWebpackPlugin({ filename: 'demo/index.html' }), + new FaviconsWebpackPlugin({ logo, mode: 'light' }) + ] + }); + + snapshotCompilationAssets(t, compilationStats); +}); + +test.afterEach(t => fs.remove(t.context.root)); diff --git a/test/snapshots/default.test.js.md b/test/snapshots/default.test.js.md index d98fc92f..22ed0e70 100644 --- a/test/snapshots/default.test.js.md +++ b/test/snapshots/default.test.js.md @@ -259,10 +259,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -319,47 +319,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -373,9 +373,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -413,7 +413,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/default.test.js.snap b/test/snapshots/default.test.js.snap index 4db0dcbe..3ee7bf3a 100644 Binary files a/test/snapshots/default.test.js.snap and b/test/snapshots/default.test.js.snap differ diff --git a/test/snapshots/html.false.test.js.md b/test/snapshots/html.false.test.js.md index 0f814709..c87a681d 100644 --- a/test/snapshots/html.false.test.js.md +++ b/test/snapshots/html.false.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -320,47 +320,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -374,9 +374,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -690,10 +690,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -750,47 +750,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -804,9 +804,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -844,7 +844,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -1120,10 +1120,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -1180,47 +1180,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -1234,9 +1234,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -1274,7 +1274,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/html.false.test.js.snap b/test/snapshots/html.false.test.js.snap index 9eb892b8..17a1ddb5 100644 Binary files a/test/snapshots/html.false.test.js.snap and b/test/snapshots/html.false.test.js.snap differ diff --git a/test/snapshots/html.multiple.test.js.md b/test/snapshots/html.multiple.test.js.md index 6e27cb07..1bcfc942 100644 --- a/test/snapshots/html.multiple.test.js.md +++ b/test/snapshots/html.multiple.test.js.md @@ -86,25 +86,25 @@ Generated by [AVA](https://ava.li). ␊ ␊ ␊ ␊ ␊ @@ -457,10 +457,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -517,47 +517,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -571,9 +571,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -611,7 +611,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/html.multiple.test.js.snap b/test/snapshots/html.multiple.test.js.snap index dc61d4a9..6d526307 100644 Binary files a/test/snapshots/html.multiple.test.js.snap and b/test/snapshots/html.multiple.test.js.snap differ diff --git a/test/snapshots/html.true.test.js.md b/test/snapshots/html.true.test.js.md index c8c72c02..1ed33c16 100644 --- a/test/snapshots/html.true.test.js.md +++ b/test/snapshots/html.true.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -320,47 +320,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -374,9 +374,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -427,25 +427,25 @@ Generated by [AVA](https://ava.li). ␊ ␊ ␊ ␊ ␊ @@ -874,10 +874,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -934,47 +934,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -988,9 +988,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/assets/firefox_app_60x60.png",␊ - "128": "/assets/firefox_app_128x128.png",␊ - "512": "/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -1028,7 +1028,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -1039,25 +1039,25 @@ Generated by [AVA](https://ava.li). content: `␊ ␊ ␊ ␊ `, diff --git a/test/snapshots/html.true.test.js.snap b/test/snapshots/html.true.test.js.snap index ae52844d..48f2a2d4 100644 Binary files a/test/snapshots/html.true.test.js.snap and b/test/snapshots/html.true.test.js.snap differ diff --git a/test/snapshots/outputpathoption.test.js.md b/test/snapshots/outputpathoption.test.js.md index 0d76011f..759ddf30 100644 --- a/test/snapshots/outputpathoption.test.js.md +++ b/test/snapshots/outputpathoption.test.js.md @@ -456,10 +456,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -516,47 +516,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/public/path/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -570,9 +570,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/public/path/assets/firefox_app_60x60.png",␊ - "128": "/public/path/assets/firefox_app_128x128.png",␊ - "512": "/public/path/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -610,7 +610,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/public/path/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/outputpathoption.test.js.snap b/test/snapshots/outputpathoption.test.js.snap index 9ef05e47..e60c8275 100644 Binary files a/test/snapshots/outputpathoption.test.js.snap and b/test/snapshots/outputpathoption.test.js.snap differ diff --git a/test/snapshots/prefixed.test.js.md b/test/snapshots/prefixed.test.js.md index 0ce7ea16..d2d0c614 100644 --- a/test/snapshots/prefixed.test.js.md +++ b/test/snapshots/prefixed.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -320,47 +320,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -374,9 +374,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/custom/prefix/__replaced_hash_8/firefox_app_60x60.png",␊ - "128": "/custom/prefix/__replaced_hash_8/firefox_app_128x128.png",␊ - "512": "/custom/prefix/__replaced_hash_8/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/custom/prefix/__replaced_hash_8/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -942,10 +942,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -1002,47 +1002,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/custom/prefix/__replaced_hash_8/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -1056,9 +1056,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/custom/prefix/__replaced_hash_8/firefox_app_60x60.png",␊ - "128": "/custom/prefix/__replaced_hash_8/firefox_app_128x128.png",␊ - "512": "/custom/prefix/__replaced_hash_8/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -1096,7 +1096,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/custom/prefix/__replaced_hash_8/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/prefixed.test.js.snap b/test/snapshots/prefixed.test.js.snap index 3e8be451..1d214597 100644 Binary files a/test/snapshots/prefixed.test.js.snap and b/test/snapshots/prefixed.test.js.snap differ diff --git a/test/snapshots/publicpath.test.js.md b/test/snapshots/publicpath.test.js.md index 5b43204c..aa9b2721 100644 --- a/test/snapshots/publicpath.test.js.md +++ b/test/snapshots/publicpath.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -320,47 +320,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/public/path/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/public/path/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -374,9 +374,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/public/path/assets/firefox_app_60x60.png",␊ - "128": "/public/path/assets/firefox_app_128x128.png",␊ - "512": "/public/path/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/public/path/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ @@ -617,3 +617,1231 @@ Generated by [AVA](https://ava.li). `, }, ] + +## should work with an empty public path + +> Snapshot 1 + + [ + 'assets/android-chrome-144x144.png', + 'assets/android-chrome-192x192.png', + 'assets/android-chrome-256x256.png', + 'assets/android-chrome-36x36.png', + 'assets/android-chrome-384x384.png', + 'assets/android-chrome-48x48.png', + 'assets/android-chrome-512x512.png', + 'assets/android-chrome-72x72.png', + 'assets/android-chrome-96x96.png', + 'assets/apple-touch-icon-1024x1024.png', + 'assets/apple-touch-icon-114x114.png', + 'assets/apple-touch-icon-120x120.png', + 'assets/apple-touch-icon-144x144.png', + 'assets/apple-touch-icon-152x152.png', + 'assets/apple-touch-icon-167x167.png', + 'assets/apple-touch-icon-180x180.png', + 'assets/apple-touch-icon-57x57.png', + 'assets/apple-touch-icon-60x60.png', + 'assets/apple-touch-icon-72x72.png', + 'assets/apple-touch-icon-76x76.png', + 'assets/apple-touch-icon-precomposed.png', + 'assets/apple-touch-icon.png', + 'assets/apple-touch-startup-image-1125x2436.png', + 'assets/apple-touch-startup-image-1136x640.png', + 'assets/apple-touch-startup-image-1242x2208.png', + 'assets/apple-touch-startup-image-1242x2688.png', + 'assets/apple-touch-startup-image-1334x750.png', + 'assets/apple-touch-startup-image-1536x2048.png', + 'assets/apple-touch-startup-image-1620x2160.png', + 'assets/apple-touch-startup-image-1668x2224.png', + 'assets/apple-touch-startup-image-1668x2388.png', + 'assets/apple-touch-startup-image-1792x828.png', + 'assets/apple-touch-startup-image-2048x1536.png', + 'assets/apple-touch-startup-image-2048x2732.png', + 'assets/apple-touch-startup-image-2160x1620.png', + 'assets/apple-touch-startup-image-2208x1242.png', + 'assets/apple-touch-startup-image-2224x1668.png', + 'assets/apple-touch-startup-image-2388x1668.png', + 'assets/apple-touch-startup-image-2436x1125.png', + 'assets/apple-touch-startup-image-2688x1242.png', + 'assets/apple-touch-startup-image-2732x2048.png', + 'assets/apple-touch-startup-image-640x1136.png', + 'assets/apple-touch-startup-image-750x1334.png', + 'assets/apple-touch-startup-image-828x1792.png', + 'assets/browserconfig.xml', + 'assets/coast-228x228.png', + 'assets/favicon-16x16.png', + 'assets/favicon-32x32.png', + 'assets/favicon-48x48.png', + 'assets/favicon.ico', + 'assets/firefox_app_128x128.png', + 'assets/firefox_app_512x512.png', + 'assets/firefox_app_60x60.png', + 'assets/manifest.json', + 'assets/manifest.webapp', + 'assets/mstile-144x144.png', + 'assets/mstile-150x150.png', + 'assets/mstile-310x150.png', + 'assets/mstile-310x310.png', + 'assets/mstile-70x70.png', + 'assets/yandex-browser-50x50.png', + 'assets/yandex-browser-manifest.json', + 'index.html', + 'main.js', + ] + +> Snapshot 2 + + [ + { + assetName: 'assets/android-chrome-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/android-chrome-192x192.png', + content: 'png 192x192', + }, + { + assetName: 'assets/android-chrome-256x256.png', + content: 'png 256x256', + }, + { + assetName: 'assets/android-chrome-36x36.png', + content: 'png 36x36', + }, + { + assetName: 'assets/android-chrome-384x384.png', + content: 'png 384x384', + }, + { + assetName: 'assets/android-chrome-48x48.png', + content: 'png 48x48', + }, + { + assetName: 'assets/android-chrome-512x512.png', + content: 'png 512x512', + }, + { + assetName: 'assets/android-chrome-72x72.png', + content: 'png 72x72', + }, + { + assetName: 'assets/android-chrome-96x96.png', + content: 'png 96x96', + }, + { + assetName: 'assets/apple-touch-icon-1024x1024.png', + content: 'png 1024x1024', + }, + { + assetName: 'assets/apple-touch-icon-114x114.png', + content: 'png 114x114', + }, + { + assetName: 'assets/apple-touch-icon-120x120.png', + content: 'png 120x120', + }, + { + assetName: 'assets/apple-touch-icon-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/apple-touch-icon-152x152.png', + content: 'png 152x152', + }, + { + assetName: 'assets/apple-touch-icon-167x167.png', + content: 'png 167x167', + }, + { + assetName: 'assets/apple-touch-icon-180x180.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-icon-57x57.png', + content: 'png 57x57', + }, + { + assetName: 'assets/apple-touch-icon-60x60.png', + content: 'png 60x60', + }, + { + assetName: 'assets/apple-touch-icon-72x72.png', + content: 'png 72x72', + }, + { + assetName: 'assets/apple-touch-icon-76x76.png', + content: 'png 76x76', + }, + { + assetName: 'assets/apple-touch-icon-precomposed.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-icon.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-startup-image-1125x2436.png', + content: 'png 1125x2436', + }, + { + assetName: 'assets/apple-touch-startup-image-1136x640.png', + content: 'png 1136x640', + }, + { + assetName: 'assets/apple-touch-startup-image-1242x2208.png', + content: 'png 1242x2208', + }, + { + assetName: 'assets/apple-touch-startup-image-1242x2688.png', + content: 'png 1242x2688', + }, + { + assetName: 'assets/apple-touch-startup-image-1334x750.png', + content: 'png 1334x750', + }, + { + assetName: 'assets/apple-touch-startup-image-1536x2048.png', + content: 'png 1536x2048', + }, + { + assetName: 'assets/apple-touch-startup-image-1620x2160.png', + content: 'png 1620x2160', + }, + { + assetName: 'assets/apple-touch-startup-image-1668x2224.png', + content: 'png 1668x2224', + }, + { + assetName: 'assets/apple-touch-startup-image-1668x2388.png', + content: 'png 1668x2388', + }, + { + assetName: 'assets/apple-touch-startup-image-1792x828.png', + content: 'png 1792x828', + }, + { + assetName: 'assets/apple-touch-startup-image-2048x1536.png', + content: 'png 2048x1536', + }, + { + assetName: 'assets/apple-touch-startup-image-2048x2732.png', + content: 'png 2048x2732', + }, + { + assetName: 'assets/apple-touch-startup-image-2160x1620.png', + content: 'png 2160x1620', + }, + { + assetName: 'assets/apple-touch-startup-image-2208x1242.png', + content: 'png 2208x1242', + }, + { + assetName: 'assets/apple-touch-startup-image-2224x1668.png', + content: 'png 2224x1668', + }, + { + assetName: 'assets/apple-touch-startup-image-2388x1668.png', + content: 'png 2388x1668', + }, + { + assetName: 'assets/apple-touch-startup-image-2436x1125.png', + content: 'png 2436x1125', + }, + { + assetName: 'assets/apple-touch-startup-image-2688x1242.png', + content: 'png 2688x1242', + }, + { + assetName: 'assets/apple-touch-startup-image-2732x2048.png', + content: 'png 2732x2048', + }, + { + assetName: 'assets/apple-touch-startup-image-640x1136.png', + content: 'png 640x1136', + }, + { + assetName: 'assets/apple-touch-startup-image-750x1334.png', + content: 'png 750x1334', + }, + { + assetName: 'assets/apple-touch-startup-image-828x1792.png', + content: 'png 828x1792', + }, + { + assetName: 'assets/browserconfig.xml', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + #fff␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + { + assetName: 'assets/coast-228x228.png', + content: 'png 228x228', + }, + { + assetName: 'assets/favicon-16x16.png', + content: 'png 16x16', + }, + { + assetName: 'assets/favicon-32x32.png', + content: 'png 32x32', + }, + { + assetName: 'assets/favicon-48x48.png', + content: 'png 48x48', + }, + { + assetName: 'assets/favicon.ico', + content: 'ico 16x16', + }, + { + assetName: 'assets/firefox_app_128x128.png', + content: 'png 128x128', + }, + { + assetName: 'assets/firefox_app_512x512.png', + content: 'png 512x512', + }, + { + assetName: 'assets/firefox_app_60x60.png', + content: 'png 60x60', + }, + { + assetName: 'assets/manifest.json', + content: `{␊ + "name": null,␊ + "short_name": null,␊ + "description": null,␊ + "dir": "auto",␊ + "lang": "en-US",␊ + "display": "standalone",␊ + "orientation": "any",␊ + "start_url": "/?homescreen=1",␊ + "background_color": "#fff",␊ + "theme_color": "#fff",␊ + "icons": [␊ + {␊ + "src": "android-chrome-36x36.png",␊ + "sizes": "36x36",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-48x48.png",␊ + "sizes": "48x48",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-72x72.png",␊ + "sizes": "72x72",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-96x96.png",␊ + "sizes": "96x96",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-144x144.png",␊ + "sizes": "144x144",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-192x192.png",␊ + "sizes": "192x192",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-256x256.png",␊ + "sizes": "256x256",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-384x384.png",␊ + "sizes": "384x384",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-512x512.png",␊ + "sizes": "512x512",␊ + "type": "image/png"␊ + }␊ + ]␊ + }`, + }, + { + assetName: 'assets/manifest.webapp', + content: `{␊ + "version": "1.0",␊ + "name": null,␊ + "description": null,␊ + "icons": {␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ + },␊ + "developer": {␊ + "name": null,␊ + "url": null␊ + }␊ + }`, + }, + { + assetName: 'assets/mstile-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/mstile-150x150.png', + content: 'png 150x150', + }, + { + assetName: 'assets/mstile-310x150.png', + content: 'png 310x150', + }, + { + assetName: 'assets/mstile-310x310.png', + content: 'png 310x310', + }, + { + assetName: 'assets/mstile-70x70.png', + content: 'png 70x70', + }, + { + assetName: 'assets/yandex-browser-50x50.png', + content: 'png 50x50', + }, + { + assetName: 'assets/yandex-browser-manifest.json', + content: `{␊ + "version": "1.0",␊ + "api_version": 1,␊ + "layout": {␊ + "logo": "yandex-browser-50x50.png",␊ + "color": "#fff",␊ + "show_title": true␊ + }␊ + }`, + }, + { + assetName: 'index.html', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + ] + +## should work with an empty public path and a nested html file + +> Snapshot 1 + + [ + 'assets/android-chrome-144x144.png', + 'assets/android-chrome-192x192.png', + 'assets/android-chrome-256x256.png', + 'assets/android-chrome-36x36.png', + 'assets/android-chrome-384x384.png', + 'assets/android-chrome-48x48.png', + 'assets/android-chrome-512x512.png', + 'assets/android-chrome-72x72.png', + 'assets/android-chrome-96x96.png', + 'assets/apple-touch-icon-1024x1024.png', + 'assets/apple-touch-icon-114x114.png', + 'assets/apple-touch-icon-120x120.png', + 'assets/apple-touch-icon-144x144.png', + 'assets/apple-touch-icon-152x152.png', + 'assets/apple-touch-icon-167x167.png', + 'assets/apple-touch-icon-180x180.png', + 'assets/apple-touch-icon-57x57.png', + 'assets/apple-touch-icon-60x60.png', + 'assets/apple-touch-icon-72x72.png', + 'assets/apple-touch-icon-76x76.png', + 'assets/apple-touch-icon-precomposed.png', + 'assets/apple-touch-icon.png', + 'assets/apple-touch-startup-image-1125x2436.png', + 'assets/apple-touch-startup-image-1136x640.png', + 'assets/apple-touch-startup-image-1242x2208.png', + 'assets/apple-touch-startup-image-1242x2688.png', + 'assets/apple-touch-startup-image-1334x750.png', + 'assets/apple-touch-startup-image-1536x2048.png', + 'assets/apple-touch-startup-image-1620x2160.png', + 'assets/apple-touch-startup-image-1668x2224.png', + 'assets/apple-touch-startup-image-1668x2388.png', + 'assets/apple-touch-startup-image-1792x828.png', + 'assets/apple-touch-startup-image-2048x1536.png', + 'assets/apple-touch-startup-image-2048x2732.png', + 'assets/apple-touch-startup-image-2160x1620.png', + 'assets/apple-touch-startup-image-2208x1242.png', + 'assets/apple-touch-startup-image-2224x1668.png', + 'assets/apple-touch-startup-image-2388x1668.png', + 'assets/apple-touch-startup-image-2436x1125.png', + 'assets/apple-touch-startup-image-2688x1242.png', + 'assets/apple-touch-startup-image-2732x2048.png', + 'assets/apple-touch-startup-image-640x1136.png', + 'assets/apple-touch-startup-image-750x1334.png', + 'assets/apple-touch-startup-image-828x1792.png', + 'assets/browserconfig.xml', + 'assets/coast-228x228.png', + 'assets/favicon-16x16.png', + 'assets/favicon-32x32.png', + 'assets/favicon-48x48.png', + 'assets/favicon.ico', + 'assets/firefox_app_128x128.png', + 'assets/firefox_app_512x512.png', + 'assets/firefox_app_60x60.png', + 'assets/manifest.json', + 'assets/manifest.webapp', + 'assets/mstile-144x144.png', + 'assets/mstile-150x150.png', + 'assets/mstile-310x150.png', + 'assets/mstile-310x310.png', + 'assets/mstile-70x70.png', + 'assets/yandex-browser-50x50.png', + 'assets/yandex-browser-manifest.json', + 'demo/index.html', + 'main.js', + ] + +> Snapshot 2 + + [ + { + assetName: 'assets/android-chrome-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/android-chrome-192x192.png', + content: 'png 192x192', + }, + { + assetName: 'assets/android-chrome-256x256.png', + content: 'png 256x256', + }, + { + assetName: 'assets/android-chrome-36x36.png', + content: 'png 36x36', + }, + { + assetName: 'assets/android-chrome-384x384.png', + content: 'png 384x384', + }, + { + assetName: 'assets/android-chrome-48x48.png', + content: 'png 48x48', + }, + { + assetName: 'assets/android-chrome-512x512.png', + content: 'png 512x512', + }, + { + assetName: 'assets/android-chrome-72x72.png', + content: 'png 72x72', + }, + { + assetName: 'assets/android-chrome-96x96.png', + content: 'png 96x96', + }, + { + assetName: 'assets/apple-touch-icon-1024x1024.png', + content: 'png 1024x1024', + }, + { + assetName: 'assets/apple-touch-icon-114x114.png', + content: 'png 114x114', + }, + { + assetName: 'assets/apple-touch-icon-120x120.png', + content: 'png 120x120', + }, + { + assetName: 'assets/apple-touch-icon-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/apple-touch-icon-152x152.png', + content: 'png 152x152', + }, + { + assetName: 'assets/apple-touch-icon-167x167.png', + content: 'png 167x167', + }, + { + assetName: 'assets/apple-touch-icon-180x180.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-icon-57x57.png', + content: 'png 57x57', + }, + { + assetName: 'assets/apple-touch-icon-60x60.png', + content: 'png 60x60', + }, + { + assetName: 'assets/apple-touch-icon-72x72.png', + content: 'png 72x72', + }, + { + assetName: 'assets/apple-touch-icon-76x76.png', + content: 'png 76x76', + }, + { + assetName: 'assets/apple-touch-icon-precomposed.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-icon.png', + content: 'png 180x180', + }, + { + assetName: 'assets/apple-touch-startup-image-1125x2436.png', + content: 'png 1125x2436', + }, + { + assetName: 'assets/apple-touch-startup-image-1136x640.png', + content: 'png 1136x640', + }, + { + assetName: 'assets/apple-touch-startup-image-1242x2208.png', + content: 'png 1242x2208', + }, + { + assetName: 'assets/apple-touch-startup-image-1242x2688.png', + content: 'png 1242x2688', + }, + { + assetName: 'assets/apple-touch-startup-image-1334x750.png', + content: 'png 1334x750', + }, + { + assetName: 'assets/apple-touch-startup-image-1536x2048.png', + content: 'png 1536x2048', + }, + { + assetName: 'assets/apple-touch-startup-image-1620x2160.png', + content: 'png 1620x2160', + }, + { + assetName: 'assets/apple-touch-startup-image-1668x2224.png', + content: 'png 1668x2224', + }, + { + assetName: 'assets/apple-touch-startup-image-1668x2388.png', + content: 'png 1668x2388', + }, + { + assetName: 'assets/apple-touch-startup-image-1792x828.png', + content: 'png 1792x828', + }, + { + assetName: 'assets/apple-touch-startup-image-2048x1536.png', + content: 'png 2048x1536', + }, + { + assetName: 'assets/apple-touch-startup-image-2048x2732.png', + content: 'png 2048x2732', + }, + { + assetName: 'assets/apple-touch-startup-image-2160x1620.png', + content: 'png 2160x1620', + }, + { + assetName: 'assets/apple-touch-startup-image-2208x1242.png', + content: 'png 2208x1242', + }, + { + assetName: 'assets/apple-touch-startup-image-2224x1668.png', + content: 'png 2224x1668', + }, + { + assetName: 'assets/apple-touch-startup-image-2388x1668.png', + content: 'png 2388x1668', + }, + { + assetName: 'assets/apple-touch-startup-image-2436x1125.png', + content: 'png 2436x1125', + }, + { + assetName: 'assets/apple-touch-startup-image-2688x1242.png', + content: 'png 2688x1242', + }, + { + assetName: 'assets/apple-touch-startup-image-2732x2048.png', + content: 'png 2732x2048', + }, + { + assetName: 'assets/apple-touch-startup-image-640x1136.png', + content: 'png 640x1136', + }, + { + assetName: 'assets/apple-touch-startup-image-750x1334.png', + content: 'png 750x1334', + }, + { + assetName: 'assets/apple-touch-startup-image-828x1792.png', + content: 'png 828x1792', + }, + { + assetName: 'assets/browserconfig.xml', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + #fff␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + { + assetName: 'assets/coast-228x228.png', + content: 'png 228x228', + }, + { + assetName: 'assets/favicon-16x16.png', + content: 'png 16x16', + }, + { + assetName: 'assets/favicon-32x32.png', + content: 'png 32x32', + }, + { + assetName: 'assets/favicon-48x48.png', + content: 'png 48x48', + }, + { + assetName: 'assets/favicon.ico', + content: 'ico 16x16', + }, + { + assetName: 'assets/firefox_app_128x128.png', + content: 'png 128x128', + }, + { + assetName: 'assets/firefox_app_512x512.png', + content: 'png 512x512', + }, + { + assetName: 'assets/firefox_app_60x60.png', + content: 'png 60x60', + }, + { + assetName: 'assets/manifest.json', + content: `{␊ + "name": null,␊ + "short_name": null,␊ + "description": null,␊ + "dir": "auto",␊ + "lang": "en-US",␊ + "display": "standalone",␊ + "orientation": "any",␊ + "start_url": "/?homescreen=1",␊ + "background_color": "#fff",␊ + "theme_color": "#fff",␊ + "icons": [␊ + {␊ + "src": "android-chrome-36x36.png",␊ + "sizes": "36x36",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-48x48.png",␊ + "sizes": "48x48",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-72x72.png",␊ + "sizes": "72x72",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-96x96.png",␊ + "sizes": "96x96",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-144x144.png",␊ + "sizes": "144x144",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-192x192.png",␊ + "sizes": "192x192",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-256x256.png",␊ + "sizes": "256x256",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-384x384.png",␊ + "sizes": "384x384",␊ + "type": "image/png"␊ + },␊ + {␊ + "src": "android-chrome-512x512.png",␊ + "sizes": "512x512",␊ + "type": "image/png"␊ + }␊ + ]␊ + }`, + }, + { + assetName: 'assets/manifest.webapp', + content: `{␊ + "version": "1.0",␊ + "name": null,␊ + "description": null,␊ + "icons": {␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ + },␊ + "developer": {␊ + "name": null,␊ + "url": null␊ + }␊ + }`, + }, + { + assetName: 'assets/mstile-144x144.png', + content: 'png 144x144', + }, + { + assetName: 'assets/mstile-150x150.png', + content: 'png 150x150', + }, + { + assetName: 'assets/mstile-310x150.png', + content: 'png 310x150', + }, + { + assetName: 'assets/mstile-310x310.png', + content: 'png 310x310', + }, + { + assetName: 'assets/mstile-70x70.png', + content: 'png 70x70', + }, + { + assetName: 'assets/yandex-browser-50x50.png', + content: 'png 50x50', + }, + { + assetName: 'assets/yandex-browser-manifest.json', + content: `{␊ + "version": "1.0",␊ + "api_version": 1,␊ + "layout": {␊ + "logo": "yandex-browser-50x50.png",␊ + "color": "#fff",␊ + "show_title": true␊ + }␊ + }`, + }, + { + assetName: 'demo/index.html', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + ] diff --git a/test/snapshots/publicpath.test.js.snap b/test/snapshots/publicpath.test.js.snap index 04f78835..46895cdc 100644 Binary files a/test/snapshots/publicpath.test.js.snap and b/test/snapshots/publicpath.test.js.snap differ diff --git a/test/snapshots/publicpathLight.test.js.md b/test/snapshots/publicpathLight.test.js.md new file mode 100644 index 00000000..46dfba35 --- /dev/null +++ b/test/snapshots/publicpathLight.test.js.md @@ -0,0 +1,107 @@ +# Snapshot report for `test/publicpathLight.test.js` + +The actual snapshot is saved in `publicpathLight.test.js.snap`. + +Generated by [AVA](https://ava.li). + +## should take the public path into account + +> Snapshot 1 + + [ + 'assets/favicon.png', + 'index.html', + 'main.js', + ] + +> Snapshot 2 + + [ + { + assetName: 'assets/favicon.png', + content: 'png 874x989', + }, + { + assetName: 'index.html', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + ] + +## should work with an empty public path + +> Snapshot 1 + + [ + 'assets/favicon.png', + 'index.html', + 'main.js', + ] + +> Snapshot 2 + + [ + { + assetName: 'assets/favicon.png', + content: 'png 874x989', + }, + { + assetName: 'index.html', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + ] + +## should work with an empty public path and a nested html file + +> Snapshot 1 + + [ + 'assets/favicon.png', + 'demo/index.html', + 'main.js', + ] + +> Snapshot 2 + + [ + { + assetName: 'assets/favicon.png', + content: 'png 874x989', + }, + { + assetName: 'demo/index.html', + content: `␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + ␊ + `, + }, + ] diff --git a/test/snapshots/publicpathLight.test.js.snap b/test/snapshots/publicpathLight.test.js.snap new file mode 100644 index 00000000..366468ce Binary files /dev/null and b/test/snapshots/publicpathLight.test.js.snap differ diff --git a/test/snapshots/publicpathoption.test.js.md b/test/snapshots/publicpathoption.test.js.md index 9922eb10..289462a4 100644 --- a/test/snapshots/publicpathoption.test.js.md +++ b/test/snapshots/publicpathoption.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -320,47 +320,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/another/path/assets/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/another/path/assets/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -374,9 +374,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/another/path/assets/firefox_app_60x60.png",␊ - "128": "/another/path/assets/firefox_app_128x128.png",␊ - "512": "/another/path/assets/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -414,7 +414,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/another/path/assets/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/publicpathoption.test.js.snap b/test/snapshots/publicpathoption.test.js.snap index c3afc6cd..b67da298 100644 Binary files a/test/snapshots/publicpathoption.test.js.snap and b/test/snapshots/publicpathoption.test.js.snap differ diff --git a/test/snapshots/unprefixed.test.js.md b/test/snapshots/unprefixed.test.js.md index fb6b7fa0..7487c8e2 100644 --- a/test/snapshots/unprefixed.test.js.md +++ b/test/snapshots/unprefixed.test.js.md @@ -260,10 +260,10 @@ Generated by [AVA](https://ava.li). ␊ - ␊ - ␊ - ␊ - ␊ + ␊ + ␊ + ␊ + #fff␊ ␊ ␊ @@ -516,47 +516,47 @@ Generated by [AVA](https://ava.li). "theme_color": "#fff",␊ "icons": [␊ {␊ - "src": "/android-chrome-36x36.png",␊ + "src": "android-chrome-36x36.png",␊ "sizes": "36x36",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-48x48.png",␊ + "src": "android-chrome-48x48.png",␊ "sizes": "48x48",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-72x72.png",␊ + "src": "android-chrome-72x72.png",␊ "sizes": "72x72",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-96x96.png",␊ + "src": "android-chrome-96x96.png",␊ "sizes": "96x96",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-144x144.png",␊ + "src": "android-chrome-144x144.png",␊ "sizes": "144x144",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-192x192.png",␊ + "src": "android-chrome-192x192.png",␊ "sizes": "192x192",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-256x256.png",␊ + "src": "android-chrome-256x256.png",␊ "sizes": "256x256",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-384x384.png",␊ + "src": "android-chrome-384x384.png",␊ "sizes": "384x384",␊ "type": "image/png"␊ },␊ {␊ - "src": "/android-chrome-512x512.png",␊ + "src": "android-chrome-512x512.png",␊ "sizes": "512x512",␊ "type": "image/png"␊ }␊ @@ -570,9 +570,9 @@ Generated by [AVA](https://ava.li). "name": null,␊ "description": null,␊ "icons": {␊ - "60": "/firefox_app_60x60.png",␊ - "128": "/firefox_app_128x128.png",␊ - "512": "/firefox_app_512x512.png"␊ + "60": "firefox_app_60x60.png",␊ + "128": "firefox_app_128x128.png",␊ + "512": "firefox_app_512x512.png"␊ },␊ "developer": {␊ "name": null,␊ @@ -610,7 +610,7 @@ Generated by [AVA](https://ava.li). "version": "1.0",␊ "api_version": 1,␊ "layout": {␊ - "logo": "/yandex-browser-50x50.png",␊ + "logo": "yandex-browser-50x50.png",␊ "color": "#fff",␊ "show_title": true␊ }␊ diff --git a/test/snapshots/unprefixed.test.js.snap b/test/snapshots/unprefixed.test.js.snap index d4692108..70698daa 100644 Binary files a/test/snapshots/unprefixed.test.js.snap and b/test/snapshots/unprefixed.test.js.snap differ diff --git a/test/unprefixed.test.js b/test/unprefixed.test.js index a57e898d..db365b1b 100644 --- a/test/unprefixed.test.js +++ b/test/unprefixed.test.js @@ -13,7 +13,8 @@ test('should correctly handle an empty prefix', async t => { const compilationStats = await generate({ context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [ new HtmlWebpackPlugin(), diff --git a/test/util.js b/test/util.js index aaea2e6a..3e8e9e0b 100644 --- a/test/util.js +++ b/test/util.js @@ -21,9 +21,7 @@ module.exports.compiler = config => { { entry: path.resolve(fixtures, 'entry.js'), plugins: [], - output: { - publicPath: '/' - }, + output: {}, infrastructureLogging: { level: 'info' } diff --git a/test/zero-config.test.js b/test/zero-config.test.js index c56dfd29..7ce48895 100644 --- a/test/zero-config.test.js +++ b/test/zero-config.test.js @@ -18,7 +18,8 @@ test('should work without configuration', async t => { mode: 'development', context: t.context.root, output: { - path: dist + path: dist, + publicPath: '/' }, plugins: [new HtmlWebpackPlugin(), new FaviconsWebpackPlugin()] });