1). var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin'); // require plugin into the webpack config file
2). added following to webpack plugins
3). import runtime from 'serviceworker-webpack-plugin/lib/runtime'; in the main.js file always throws error.
runtime.js file always throws error as we can see into the source code.
when I change
import runtime from 'serviceworker-webpack-plugin/lib/runtime';
to
import runtime from 'serviceworker-webpack-plugin/lib/runtimeTemplate';
it builds, but then I'm getting another error on the browser.
_client.js?cf27:63 ReferenceError: serviceWorkerOption is not defined
at Object.register (eval at <anonymous> (main.js?48625b094889c52616ad:3544), <anonymous>:13:30)_
we are not getting serviceWorkerOption into global. I'm not sure how serviceWorkerOption is being injected into the global.
import runtime from 'serviceworker-webpack-plugin/lib/runtime';
always throws below errorError: serviceworker-webpack-plugin: It seems that your are importing "serviceworker-webpack-plugin/lib/runtime" without using the plugin.
I installed 'serviceworker-webpack-plugin' by
npm install serviceworker-webpack-plugin@0
for 'webpack 1'Versions.
Repro steps.
1).
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
// require plugin into the webpack config file 2). added following to webpack plugins3).
import runtime from 'serviceworker-webpack-plugin/lib/runtime';
in the main.js file always throws error.runtime.js file always throws error as we can see into the source code.
when I change
import runtime from 'serviceworker-webpack-plugin/lib/runtime';
toimport runtime from 'serviceworker-webpack-plugin/lib/runtimeTemplate';
it builds, but then I'm getting another error on the browser.we are not getting serviceWorkerOption into global. I'm not sure how serviceWorkerOption is being injected into the global.