Skip to content

Commit

Permalink
Merge pull request #17 from sanyu1225/feature
Browse files Browse the repository at this point in the history
version 1.1.0
  • Loading branch information
sanyu1225 authored Feb 10, 2022
2 parents 0b4d5a5 + eb138f6 commit 503ff90
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ vue add chrome-extension-cli
### 本地开发 跟 生产模式

- 使用` npm run build-watch`运行开发模式,将生成一个`dist`文件。 安装[Extension Reloader](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid),以便在热更新。 (注意,当您更改 manifest.json 文件时,它不会自动加载,您需要点选 extension 页面中的更新)
- ### manifest版本 3 不支援使用 `npm run build-watch` 因为 manifest版本 3不支援 [CSP](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#content-security-policy)
- 生产模式 `npm run build`,并将其压缩成 zip 并部署到 chrome 商店中。

### prompts.js
Expand Down
2 changes: 1 addition & 1 deletion README-zh_TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ vue add chrome-extension-cli
### 本地開發 跟 生產模式

- 使用` npm run build-watch`運行開發模式,將生成一個`dist`文件。 安裝[Extension Reloader](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid),以便在熱更新。 (注意,當您更改 manifest.json 文件時,它不會自動加載,您需要點選 extension 頁面中的更新)
- ### manifest版本 3 不支援使用 `npm run build-watch` 因為 manifest版本 3不支援 [CSP](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#content-security-policy)

- 生產模式 `npm run build`,並將其壓縮成 zip 並部署到 chrome 商店中。

### prompts.js
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ vue add chrome-extension-cli
### Run Development mode and Production

- Run development mode with `npm run build-watch` and a `dist` file will be generated. Install [Extension Reloader](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid) to reload chrome extensions easily everytime you reload. (take note that when u change manifest.json file, it will not automatically load, you need to click update extension )
- ### manifest_version 3 can't use `npm run build-watch` beacause version 3 can't support [CSP](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#content-security-policy)

- Build for production `npm run build` and zip it and deploy onto chrome store.
### prompts.js

Expand Down
2 changes: 1 addition & 1 deletion generator/generate/editPackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = (api, isTypeScript) => {
const extPkg = {
scripts: {
'build-watch': 'vue-cli-service build-watch --mode development'
'build-watch': 'vue-cli-service --env.NODE_ENV=development build-watch --mode development'
},
devDependencies: {
'copy-webpack-plugin': '^4.6.0'
Expand Down
5 changes: 4 additions & 1 deletion generator/template/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ chromeName.forEach((name) => {
}
})

const isDevMode = process.env.NODE_ENV === 'development'

module.exports = {
pages,
filenameHashing: false,
Expand All @@ -40,6 +42,7 @@ module.exports = {
output: {
filename: `js/[name].js`,
chunkFilename: `[name].js`
}
},
devtool: isDevMode ? 'inline-source-map' : false,
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-cli-plugin-chrome-extension-cli",
"version": "1.0.9",
"version": "1.1.0",
"description": "Use Vue CLI generate chrome extension template | generate chrome extension with vue.js",
"author": "sanyu1225 <[email protected]>",
"scripts": {},
Expand Down

0 comments on commit 503ff90

Please sign in to comment.