vuejs / vue-hackernews-2.0

HackerNews clone built with Vue 2.0, vue-router & vuex, with server-side rendering
MIT License
10.96k stars 2.15k forks source link

service-worker.js filepath error #181

Open TPORL opened 7 years ago

TPORL commented 7 years ago

service-worker.js error

service-worker.js service-worker.js

加了stripPrefix就没问题了

new SWPrecachePlugin({
  // ...
  stripPrefix: path.resolve(__dirname, '../').replace(/\\/g, '/')
})

参考: https://github.com/goldhand/sw-precache-webpack-plugin/issues/11

stephan281094 commented 7 years ago

Service workers can only be used on a server. Vue hacker news comes with a server you can use by running npm start # or yarn start from within the root of the project.