Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 1.35 KB

FAQ.md

File metadata and controls

22 lines (17 loc) · 1.35 KB

Is it possible to minify ServiceWorker script output?
Yes, offline-plugin perfectly works with official webpack.optimize.UglifyJsPlugin, so if it's used your will get minified ServiceWorker script as well (no additional options required).

Is there a way to match assets with dynamic file names, like compilation hash or version?
Yes, it's possible with pattern matching, which is performed by minimatch library.
Example: main: ['index.html', 'scripts/main.*.js'].

Is there a way to prevent/disable console logging?
Yes, you can disable/prevent console logging when webpack.optimize.UglifyPlugin is used with compress.drop_console option. Example:

new webpack.optimize.UglifyPlugin({
  compress: {
    drop_console: true,
  }
})

offline-plugin automatically detects usage of UglifyPlugin and applies it to its generated code.

Why does the use of { mode: 'no-cors' } return an error when used?
This is because the opaque request made doesn't give us access to the returned response code. We are therefore unable to determine the asset is valid. In this situation we avoid caching potential erroneous requests. Please ensure anything to be cached responds with valid CORS headers.