PWA WorkboxWebpackPlugin is not a constructor
2020-07-07 11:44
225 查看
PWA WorkboxWebpackPlugin is not a constructor
参考文章:https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin#configuration
根据webpack官网上学习PWA
const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); ... plugins: [ new WorkboxWebpackPlugin({ clientsClaim: true, skipWaiting: true }) ],
出现问题
解决办法
const {GenerateSW} = require('workbox-webpack-plugin'); ... plugins: [ new GenerateSW({ clientsClaim: true, skipWaiting: true }) ],
或者
const WorkboxWebpackPlugin = require('workbox-webpack-plugin'); ... plugins: [ new WorkboxWebpackPlugin.GenerateSW({ clientsClaim: true, skipWaiting: true }) ],
相关文章推荐
- TypeError: CleanWebpackPlugin is not a constructor
- CleanWebpackPlugin is not a constructor
- clean-webpack-plugin源码学习,TypeError: CleanWebpackPlugin is not a constructor
- Webpack.optimize.OccurenceOrderPlugin is not a constructor
- TypeError: CleanWebpackPlugin is not a constructor 的错误处理
- vuex报错__WEBPACK_IMPORTED_MODULE_1_vuex__.a.store is not a constructor
- html-webpack-plugin2.22.0、Webpack与gulp结合时出现ReferenceError: window is not defined错误的解决办法
- vue踩坑--TypeError: __WEBPACK_IMPORTED_MODULE_1_vuex__.a.store is not a constructor
- webpack DllPlugin xxx is not defined解决办法
- Vue+Webpack引入Jquery第三方插件,jQuery is not defined 错误,解决方案
- webpackJsonp is not defined?
- React 使用from.creted 报错 __WEBPACK_IMPORTED_MODULE_0_react___default.a.createRef is not a function
- 使用npm启动vue报错'webpack-dev-server' is not recognized as an internal or external command'
- Vue+Webpack引入Jquery第三方插件,jQuery is not defined 错误
- extract-text-webpack-plugin" loader is used without the corresponding plugin How to deal
- 4000 运行vue报错__WEBPACK_IMPORTED_MODULE_2__router__.a is not a constructor
- webpack 中使用 workbox 实现 PWA
- ionic3 ionic serve build fail Error: webpackJsonP is not defined
- ypeError: _api_banner__WEBPACK_IMPORTED_MODULE_0__.default.getIndexData is not a function“
- 解决 TypeError: antd_es_form__WEBPACK_IMPORTED_MODULE_7__.default.create(...) is not a function