Git Product home page Git Product logo

app-manifest-webpack-plugin's People

Contributors

jantimon avatar kajyr avatar lucassus avatar mmaday avatar nicolas-lescop avatar numical avatar ramondeklein avatar romanlex avatar viamin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

app-manifest-webpack-plugin's Issues

Cannot see generated files in dev-server

Hi there,

I'm using this plugin together with HtmlWebpackPlugin and HtmlWebpackTemplate

It works fine while bundling, i.e. generating the folders with the icons and the rest. However when using the dev server such files are emitted but are not created, i.e. when browsing the
http://localhost:<port>/webpack-dev-server URL I cannot see the folder with the icons listed and when the browser requests, for instance, a favicon, I get a 404:

http://localhost:<port>/icons-<hash>/favicon.ico
response: Cannot GET /icons-1a4ee607/favicon.ico

This is a bit annoying when developing. How can I check if I'm doing something wrong? Or is this just a bug?

Al plugins are latest versions and so is webpack

Configuration

const webpackTemplate = require('html-webpack-template')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const AppManifestWebpackPlugin = require('app-manifest-webpack-plugin')


...
  const html = new HtmlWebpackPlugin({
    inject: false,
    title: globals.title,
    template: webpackTemplate,
    mobile: true,
    appMountId: globals.appMountId,
    meta: getMetas(contentSecurityPolicy),
    links: getLinks(LINKS),
    lang: 'en',
    filename: 'index.html',
    // favicon: path.join(appDirectory, srcDirectory, 'assets', 'favicons', 'favicon.ico'),
    chunks: chunkNames,
    scripts: getScripts(SCRIPTS),
    window: globalVars
  })

const appManifest = new AppManifestWebpackPlugin({
    logo: path.resolve(srcDirectory, 'assets', logoFileName),
    emitStats: true,
    inject: true,
    statsFilename: 'iconstats.json',
    persistentCache: true,
    // Prefix for file names (html will be container icons with this prefix)
    prefix: globals.publicPath,
    // Output path for icons (icons will be saved to output.path(webpack config) + this key)
    output: '/icons-[hash:8]/',
    config: {
      appName: globals.title, // Your application's name. `string`
      appDescription: globals.description, // Your application's description. `string`
      developerName: 'Mobile Solutions LINKS Foundation', // Your (or your developer's) name. `string`
      developerURL: 'https://linksfoundation.com/en/about/research-areas/', // Your (or your developer's) URL. `string`
      background: backgroundColor, // Background colour for flattened icons. `string`
      theme_color: chromeThemeColor, // Theme color for browser chrome. `string`
      display: 'standalone', // Android display: "browser" or "standalone". `string`
      orientation: 'portrait-primary', // Android orientation: "portrait" or "landscape". `string`
      start_url: `${globals.publicPath}index.html`, // Android start application's URL. `string`
      version: '1.0', // Your application's version number. `number`
      logging: true, // Print logs to console? `boolean`
      icons: {
        // Platform Options:
        // - offset - offset in percentage
        // - shadow - drop shadow for Android icons, available online only
        // - background:
        //   * false - use default
        //   * true - force use default, e.g. set background for Android icons
        //   * color - set background for the specified icons
        //
        android: true, // Create Android homescreen icon. `boolean` or `{ offset, background, shadow }`
        appleIcon: true, // Create Apple touch icons. `boolean` or `{ offset, background }`
        appleStartup: true, // Create Apple startup images. `boolean` or `{ offset, background }`
        coast: false, // Create Opera Coast icon with offset 25%. `boolean` or `{ offset, background }`
        favicons: true, // Create regular favicons. `boolean`
        firefox: true, // Create Firefox OS icons. `boolean` or `{ offset, background }`
        windows: true, // Create Windows 8 tile icons. `boolean` or `{ background }`
        yandex: false // Create Yandex browser icon. `boolean` or `{ background }`
      }
    }
  })

const plugins = [html, appManifest ...]

globals.publicPath is '/' in dev-server mode in my setup.

Manifest.json not generated if android set to false

Hi,

Whenever I set android to be false in the config part, it does not generate a manifest.json file.
Is this the correct behaviour or am I just missing something?

Here is my set up:

 new AppManifestWebpackPlugin({
      logo: "./public/assets/icon.png",
      inject: true,
      prefix: "/ClientApp/dist/assets",
      output: "assets/",
      config: {
        appName: "{REDACTED}",
        appShortName: "{REDACTED}",
        developerName: "Josh Asi",
        background: "#fff",
        theme_color: "#0000fd",
        display: "standalone",
        orientation: "landscape",
        scope: "/",
        start_url: "../",
        version: "1.0",
        logging: false,
        icons: {
          **android: false,**
          appleIcon: true,
          appleStartup: true,
          coast: false,
          favicons: true,
          firefox: true,
          windows: true,
          yandex: false
        }
      }
    })

Not compatible with html-webpack-plugin v4

The current version of app-manifest-webpack-plugin isn't compatible with html-webpack-plugin v4. The following error is thrown:

compilation.hooks.htmlWebpackPluginAfterHtmlProcessing is lost.
   Please make sure you have installed html-webpack-plugin and put it before AppManifestWebpackPlugin

The fix for preload-webpack-plugin was fairly simple, so I guess it could be applied to this plugin as well (see https://github.com/GoogleChromeLabs/preload-webpack-plugin/pull/81/files).

Although html-webpack-plugin is still in alpha, it is used by create-react-app, so it is already widely used.

Doesn't work for any site that requires basic HTTP authentication

The manifest is never generated with crossorigin="use-credentials" thus will always get 401 error = doesn't work on any site requiring basic HTTP authentication. As far as I see there is no way to configure this package to produce the required property to avoid this fatal error.

More than one HtmlWebpackPlugin

Hi,

I have two HtmlWebpackPlugin instances, to generate two separate indexes.
Is there a way to associate one App Manifest plugin to one of them and another one to the other?

Thank you

manifest.json etc.

When using an output path, the manifest.json and other generated, non-image, files are saved in the same directory. The should default to the root directory of the application.

webpack 5 support

Hello!

I'd like to say thanks for this plugin!
Can you make webpack 5 support or you don't have time to maintain this repo anymore?

Cheers,

Manifest.json and yandex-browser-manifest.json being injected but both not created

A manifest.json file is injected into the HTML file, but it doesn't appear to be created. Is there any option I'm currently missing?

It is due to a couple of code snippets as follow:

const webpackConfig = {
	plugins: [
	    new ScriptExtHtmlWebpackPlugin({
	        inline: /manifest/
	    }),
	    new AppManifestWebpackPlugin({
	        logo: 'my-logo.png'
	    })
	]
}

name, short_name, and scope

In the configuration object, what's appName exactly? Will it become name and short_name in the manifest?

Also, is there a chance to add scope as part of the configuration? I think it's the only setting not present that is necessary for a Progressive Web App manifest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.