lavas-project/lavas

按《开发第一个 Lavas 应用》实践时出现问题

Closed this issue · 1 comments

  1. 设置workbox.routing.registerRoute(/^https:\/\/query\.yahooapis\.com\/v1\/public\/yql/, workbox.strategies.networkFirst())没有生效,而且页面文件缓存应该是默认开启的也没有生效
  2. 运行lavas build时报错:
./node_modules/.3.0.2@extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!d:/Code/lavas-2-sample/node_modules/.4.1.2@vue-style-loader!d:/Code/lavas-2-sample/node_modules/.0.28.11@css-loader?{"minimize":true,"sourceMap":true}!./node_modules/.14.2.3@vue-loader/lib/style-compiler?{"optionsId":"1","vue":true,"id":"data-v-07c3244e","scoped":true,"sourceMap":false}!d:/Code/lavas-2-sample/node_modules/.2.1.6@postcss-loader/lib?{"sourceMap":true}!d:/Code/lavas-2-sample/node_modules/.3.0.2@stylus-loader?{"sourceMap":true}!./node_modules/.14.2.3@vue-loader/lib/selector.js?type=styles&index=0!./pages/detail/_id.vue
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
    at Object.pitch (D:\Code\lavas-2-sample\node_modules\.3.0.2@extract-text-webpack-plugin\dist\loader.js:57:11)
 @ ./pages/detail/_id.vue 2:2-492
 @ ./.lavas/router.js
 @ ./core/app.js
 @ ./core/entry-client.js
 @ multi ./core/entry-client.js

extract-text-webpack-plugin默认没有安装,手动安装后依然出现上面的错误

环境是win10

开发者您好。

  1. Service Worker 只在 prod 状态下才会安装生效,你如果是用 lavas dev 启动的话,是不会安装的,也就不会生效了。
  2. 我刚尝试初始化并安装了依赖,编译了项目,是OK的呀?
    image

另外在我的 node_modules 里面,只发现了 extract-text-webpack-plugin 目录,而没有 .3.0.2@extract-xxx 这样的前缀(不过我是MAC)。
image

我猜想你是不是使用了 cnpm 之类的工具?