# Others

# mix.generateSW()

mix.generateSW(pwaOptions: object)

# mix.injectManifest()

mix.injectManifest(pwaOptions: object)

🌰 For example:

const balm = require('balm');

const workboxSw = 'node_modules/workbox-sw/build/workbox-sw.js';

balm.config = {
  pwa: {
    enabled: true, // NOTE: Just for production
    workboxSw
  }
  // Other Options...
};

balm.go(mix => {
  if (!balm.config.env.isProd) {
    mix.copy(workboxSw, balm.config.roots.tmp);
    // PWA test
    mix.generateSW();
    // mix.injectManifest();
  }
});

# mix.modernizr()

Manual generate a modernizr script by modernizr.json for development.

Last Updated: 11 days ago