从github找到Extension Boilerplate插件项目,示例丰富,插件支持Chrome, Opera & Firefox。
我在此基础上更新依赖包到最新版本,根据gulp4语法更新gulpfile.babel.js。能够成功打包。
写此记录学习历程。github地址https://github.com/jahson88/chrome-ext-template
依赖包版本如下:
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.1.2",
"babelify": "^7.3.0",
"browserify": "^14.1.0",
"cross-env": "^3.2.4",
"event-stream": "^3.3.4",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-clean": "^0.4.0",
"gulp-eslint": "^6.0.0",
"gulp-if": "^3.0.0",
"gulp-livereload": "^4.0.2",
"gulp-load-plugins": "^2.0.1",
"gulp-merge-json": "^1.3.1",
"gulp-plumber": "^1.2.1",
"gulp-rename": "^1.2.2",
"gulp-run-sequence": "*",
"gulp-sass": "^4.0.2",
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"gulp-zip": "^5.0.1",
"node-sass": "^4.13.0",
"preprocessify": "^1.0.1",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
chrome插件开发知识可以查看http://blog.haoji.me/chrome-plugin-develop.html