Comments (9)
I'm wondering if that change could help. I see that it's using the ES5 syntax.
- serviceWorkerPlugin = require('serviceworker-webpack-plugin')
+ serviceWorkerPlugin = require('serviceworker-webpack-plugin').default
from serviceworker-webpack-plugin.
Thanks, Olivier.
new serviceWorkerPlugin({
^
TypeError: serviceWorkerPlugin is not a constructor
With the .default
added, I get the above error. And removing the new
doesn't help, of course.
In reviewing what I'm doing, what I really want is simply the ability to specify a file that will be served from the root of the website beside the 'index.js', both in the dev
environment and when the build
is run. Do you have any suggestions on how I can do that? It seems that this is a webpack configuration exercise, but I haven't found how to do it.
from serviceworker-webpack-plugin.
My bad, we already have the add-module-exports
babel plugin. No need for that .default
.
from serviceworker-webpack-plugin.
I'm gonna close that issue. Sorry, I don't have time to investigate.
from serviceworker-webpack-plugin.
Hi,
I think best would be to at least leave it open for when you'll have time for it. I know how time can be an issue in itself, but this does needs a fix.
Great work with the plugin btw.
from serviceworker-webpack-plugin.
I've changed my approach so that I no longer need this plugin... so you don't need to hold it open on my behalf.
from serviceworker-webpack-plugin.
Actually, it could be linked to an issue with webpack@2. I'm looking into that.
from serviceworker-webpack-plugin.
Wrong assumption, it's working fine with it: #17.
from serviceworker-webpack-plugin.
I have figured our the issue using glittle/badi-web3@2201697.
Actually, there are two issues right here.
1. Wrong parameter
@glittle The path you are providing doesn't match with a file on the system...
-entry: path.join(__dirname, 'special/sw-badi-web3.js'),
+entry: path.join(__dirname, '../special/sw-badi-web3.js')
2. Error swallowed
@rstoenescu as the path
argument provided is invalid, the ServiceWorkerPlugin
plugin crash and throw an exception. However, that error is never showed. That's most likely due to the custom logic implemented inside build/script.dev.js
. I suggest you having a look at the https://github.com/webpack/webpack-dev-server implementation. That could help.
from serviceworker-webpack-plugin.
Related Issues (20)
- ServiceWorker script evaluation failed
- DOMException error
- Feature: pass arbitrary data to serviceworker
- Don't detect minification using webpack.optimize HOT 5
- Is there a way to add babel-polyfill using options ? HOT 6
- Serious issues with sourcemaps and multiple webpack configs. HOT 2
- Unexpected using UglifyJSPlugin in development mode HOT 3
- webpack 4 support HOT 3
- The script has an unsupported MIME type ('text/html') HOT 7
- postinstall script requires yarn HOT 1
- import runtime from 'serviceworker-webpack-plugin/lib/runtime'; always throws error HOT 1
- Cannot get the plugin to load the sw.js file inside dist folder HOT 1
- Easy way to disable plugin HOT 1
- Specify absolute path HOT 2
- Eslint dont produce explanation about errors
- Minimizing errors with UglisyJsPlugin HOT 1
- Webpack bootstrap code in sw.js file
- getRegistration
- it doesn't work with nuxt
- typescript definitions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serviceworker-webpack-plugin.