Closed kuole-o closed 3 years ago
按照这里的方法,重新安装其中的一个插件也不行
npm install --save-dev @babel/preset-react
https://stackoverflow.com/questions/65880113/react-add-babel-preset-react-https-git-io-jfedr-to-the-presets-section
我的package.json文件如下:
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "5.4.0"
},
"dependencies": {
"-": "0.0.1",
"aplayer": "^1.10.1",
"gulp-html-minifier-terser": "^6.0.1",
"hexo": "^5.4.0",
"hexo-abbrlink": "^2.2.1",
"hexo-blog-encrypt": "^3.1.6",
"hexo-browsersync": "^0.3.0",
"hexo-butterfly-douban": "^1.2.3",
"hexo-deployer-git": "^3.0.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-search": "^2.4.3",
"hexo-generator-sitemap": "^2.1.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-jade": "^0.5.0",
"hexo-renderer-marked": "^4.0.0",
"hexo-renderer-pug": "^1.0.0",
"hexo-renderer-stylus": "^2.0.1",
"hexo-server": "^2.0.0",
"hexo-tag-aplayer": "^3.0.4",
"hexo-tag-bilibili": "^0.3.1",
"hexo-theme-butterfly": "^3.7.8",
"hexo-theme-landscape": "^0.0.3",
"hexo-wordcount": "^6.0.1"
},
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-htmlclean": "^2.7.22",
"gulp-imagemin": "^7.1.0",
"gulp-terser": "^2.0.1",
"gulp-uglify": "^3.0.2",
"workbox-build": "^6.1.5"
}
}
pwa 问题自己解决 而且看问题 E:\work\Git\butterfly\public\js\style.js 这是你自己diy的js吧 谷歌以下就有解决方法啦 https://stackoverflow.com/questions/63005011/support-for-the-experimental-syntax-jsx-isnt-currently-enabled https://github.com/babel/gulp-babel#usage
pwa 问题自己解决 而且看问题 E:\work\Git\butterfly\public\js\style.js 这是你自己diy的js吧 谷歌以下就有解决方法啦 https://stackoverflow.com/questions/63005011/support-for-the-experimental-syntax-jsx-isnt-currently-enabled https://github.com/babel/gulp-babel#usage
已解决,感谢
发现还有个小问题。本地编写的manifest.json没有问题,但部署后,自动在一开始插入了以下内容:
<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\css\APlayer.min.css"><script src="\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\js\Meting.min.js"></script>
导致浏览器manifest.json报语法错误。麻烦老哥有空帮忙看看 也可以在我的网站上查看这个错误:https://guole.fun/
manifest.json源文件内容:
{
"name": "guole's Blog",
"short_name": "guole",
"theme_color": "#49b1f5",
"background_color": "#49b1f5",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "https://cdn.guole.fun/logo/36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "https://cdn.guole.fun/logo/512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"splash_pages": null
}
aplayer 插件自带的插入会在所有文件开头都插入 div 所以你要么把你这个 manifest.json 写在exclude 要么用主题的aplayer插入 不要用aplayer的
多搜索多看文档
已解决!
I want to create a Bug report
Butterfly Information
Butterfly Version: 3.7.8
Platform: Windows
Browser: Chrome
Expected behavior
使用PWA,正常压缩打包完成
Actual behavior
使用PWA,按教程装完插件,执行
gulp
命令时,报错Steps to reproduce the behavior
1.按教程安装
gulp
及PWA
,然后执行gulp
命令。 https://butterfly.js.org/posts/4073eda/#%E5%89%B5%E5%BB%BA-gulpfile-%E6%96%87%E4%BB%B6Screenshots
Website
https://guole.fun/
Describe the bug
manifest.json 文件配置如下:
gulp命令执行后的报错详情