Skip to content

Commit

Permalink
🚀 扩展程序初始化构建
Browse files Browse the repository at this point in the history
构建扩展程序
  • Loading branch information
rowthan committed Oct 17, 2018
1 parent 6b18df7 commit 04bec5c
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/easyshare.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/easyshare.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/easyshare.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h4>使用</h4>
</main>
<script src="./easyshare.js"></script>
<script>
var easyshare = new EasyShare()
var easyshare = new EasyShare("easyshare-demo")
</script>
</body>
</html>
11 changes: 11 additions & 0 deletions extenstion/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extensionName": {
"message": "web-note"
},
"extensionDescription": {
"message": "note something on you visiting page, anywhere."
},
"browserActionTitle": {
"message": "web-note"
}
}
1 change: 1 addition & 0 deletions extenstion/css/easyshare.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added extenstion/images/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extenstion/images/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extenstion/images/icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extenstion/images/icon-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extenstion/images/icon-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extenstion/images/icon-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions extenstion/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"manifest_version": 2,
"name": "__MSG_extensionName__",
"short_name": "__MSG_extensionName__",
"version": "0.1.5",
"description": "__MSG_extensionDescription__",
"default_locale": "zh_CN",
"icons": {
"16": "images/icon-16.png",
"32": "images/icon-32.png",
"48": "images/icon-48.png",
"64": "images/icon-64.png",
"96": "images/icon-96.png",
"128": "images/icon-128.png"
},
"permissions": [
"contextMenus",
"activeTab",
"tabs"
],
"browser_action": {
"default_icon": {
"16": "images/icon-16.png",
"32": "images/icon-32.png",
"48": "images/icon-48.png",
"64": "images/icon-64.png",
"96": "images/icon-96.png",
"128": "images/icon-128.png"
},
"default_title": "__MSG_browserActionTitle__"
},
"commands": {
"whats_element": {
"description": "compute element",
"suggested_key": {
"default": "Ctrl+Shift+E"
}
}
},
"background": {
"scripts": ["scripts/background.js"],
"persistent": false
},
"content_scripts": [
{
"matches": [ "<all_urls>" ],
"js": ["scripts/easyshare.js","scripts/content_script.js"],
"css":["css/easyshare.css"],
"all_frames": true
}
]
}
Empty file.
1 change: 1 addition & 0 deletions extenstion/scripts/content_script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var easyshare = new EasyShare("yes-container")
2 changes: 2 additions & 0 deletions extenstion/scripts/easyshare.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"babel-loader": "^7.0.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-env": "^1.7.0",
"copy-webpack-plugin": "^4.5.3",
"css-loader": "^1.0.0",
"mini-css-extract-plugin": "^0.4.4",
"optimize-css-assets-webpack-plugin": "^5.0.1",
Expand Down
8 changes: 8 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
Expand Down Expand Up @@ -50,5 +51,12 @@ module.exports = {
filename: "easyshare.css",
chunkFilename: "[id].css"
}),
new CopyWebpackPlugin([{
from:"dist/easyshare.js",
to :path.resolve(__dirname, 'extenstion/scripts/')
},{
from:"dist/easyshare.css",
to :path.resolve(__dirname, 'extenstion/css/')
}])
]
};

0 comments on commit 04bec5c

Please sign in to comment.