From 31b7d6a999a05fc1aac04c222be321b922f857e5 Mon Sep 17 00:00:00 2001 From: YuTengjing Date: Sun, 24 Nov 2019 23:49:10 +0800 Subject: [PATCH] :hankey: refactor: optimze some webpack and manifest configs --- server/configs/webpack.common.js | 8 ++++---- server/configs/webpack.dev.js | 2 +- src/manifest.dev.json | 9 +-------- src/manifest.prod.json | 9 +-------- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/server/configs/webpack.common.js b/server/configs/webpack.common.js index 94beabf..b7d335f 100644 --- a/server/configs/webpack.common.js +++ b/server/configs/webpack.common.js @@ -18,7 +18,7 @@ module.exports = { hotUpdateMainFilename: 'hot/[hash].hot-update.json', }, watchOptions: { - ignored: /node_modules/, + ignored: [/node_modules/, /dist/, /docs/, /server/], }, module: { rules: [ @@ -44,7 +44,7 @@ module.exports = { loader: 'postcss-loader', options: { ident: 'postcss', - plugins: [autoprefixer({})], + plugins: [autoprefixer()], }, }, ], @@ -60,7 +60,7 @@ module.exports = { loader: 'postcss-loader', options: { ident: 'postcss', - plugins: [autoprefixer({})], + plugins: [autoprefixer()], }, }, { @@ -82,7 +82,7 @@ module.exports = { loader: 'postcss-loader', options: { ident: 'postcss', - plugins: [autoprefixer({})], + plugins: [autoprefixer()], }, }, 'sass-loader', diff --git a/server/configs/webpack.dev.js b/server/configs/webpack.dev.js index beba300..e084d67 100644 --- a/server/configs/webpack.dev.js +++ b/server/configs/webpack.dev.js @@ -18,7 +18,7 @@ module.exports = merge.smart(common, { { from: resolve(projectRoot, 'src/manifest.dev.json'), to: 'manifest.json' }, ]), new CircularDependencyPlugin({ - exclude: /a\.js|node_modules/, + exclude: /node_modules/, failOnError: false, }), ], diff --git a/src/manifest.dev.json b/src/manifest.dev.json index 17e722c..e7f0ca1 100644 --- a/src/manifest.dev.json +++ b/src/manifest.dev.json @@ -3,14 +3,7 @@ "version": "1.0", "description": "牛客网 chrome 扩展", "manifest_version": 2, - "permissions": [ - "storage", - "declarativeContent", - "webRequest", - "storage", - "notifications", - "https://www.nowcoder.com/*" - ], + "permissions": ["storage", "webRequest", "notifications", "https://www.nowcoder.com/*"], "content_security_policy": "script-src 'self' 'unsafe-eval' http://localhost:3000; object-src 'self';", "minimum_chrome_version": "68", "background": { diff --git a/src/manifest.prod.json b/src/manifest.prod.json index dc9f979..18d43c3 100644 --- a/src/manifest.prod.json +++ b/src/manifest.prod.json @@ -3,14 +3,7 @@ "version": "1.0", "description": "牛客网 chrome 扩展", "manifest_version": 2, - "permissions": [ - "storage", - "declarativeContent", - "webRequest", - "storage", - "notifications", - "https://www.nowcoder.com/*" - ], + "permissions": ["webRequest", "storage", "notifications", "https://www.nowcoder.com/*"], "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';", "minimum_chrome_version": "68", "background": {