@dword-design/base-config-web-extension 1.10.34 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-to-manifest.js +14 -29
- package/dist/dev.js +6 -20
- package/dist/get-webpack-config.js +70 -0
- package/dist/index.js +21 -42
- package/dist/lint.js +4 -17
- package/dist/prepublish-only.js +11 -17
- package/package.json +23 -25
- package/dist/base-config.js +0 -19
- package/dist/webpack.config.js +0 -90
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _pick = _interopRequireDefault(require("@dword-design/functions/dist/pick"));
|
|
9
|
-
|
|
10
|
-
var _fsExtra = require("fs-extra");
|
|
11
|
-
|
|
12
|
-
var _loadPkg = _interopRequireDefault(require("load-pkg"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
var _default = async configString => {
|
|
1
|
+
import pick from "@dword-design/functions/dist/pick.js";
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import loadPkg from 'load-pkg';
|
|
4
|
+
export default (async configString => {
|
|
17
5
|
var _packageConfig, _config;
|
|
18
|
-
|
|
19
|
-
const packageConfig = await (0, _loadPkg.default)();
|
|
6
|
+
const packageConfig = await loadPkg();
|
|
20
7
|
const config = JSON.parse(configString);
|
|
21
|
-
const iconExists =
|
|
22
|
-
const popupExists =
|
|
8
|
+
const iconExists = fs.existsSync('assets/icon.png');
|
|
9
|
+
const popupExists = fs.existsSync('popup.html');
|
|
23
10
|
return JSON.stringify({
|
|
24
11
|
name: config.name,
|
|
25
|
-
...(_packageConfig = packageConfig, (
|
|
12
|
+
...(_packageConfig = packageConfig, pick(['version', 'description'])(_packageConfig)),
|
|
26
13
|
manifest_version: 2,
|
|
27
14
|
...(iconExists && {
|
|
28
15
|
icons: {
|
|
@@ -30,7 +17,8 @@ var _default = async configString => {
|
|
|
30
17
|
}
|
|
31
18
|
}),
|
|
32
19
|
...(('browser_action' in config || popupExists) && {
|
|
33
|
-
browser_action: {
|
|
20
|
+
browser_action: {
|
|
21
|
+
...(iconExists && {
|
|
34
22
|
default_icon: 'assets/icon.png'
|
|
35
23
|
}),
|
|
36
24
|
...(popupExists && {
|
|
@@ -39,21 +27,18 @@ var _default = async configString => {
|
|
|
39
27
|
...(typeof config.browser_action === 'object' && config.browser_action)
|
|
40
28
|
}
|
|
41
29
|
}),
|
|
42
|
-
...(
|
|
30
|
+
...(fs.existsSync('content.js') && {
|
|
43
31
|
content_scripts: [{
|
|
44
32
|
js: ['browser-polyfill.js', 'content.js'],
|
|
45
33
|
matches: config.matches || ['<all_urls>']
|
|
46
34
|
}]
|
|
47
35
|
}),
|
|
48
|
-
...(
|
|
36
|
+
...(fs.existsSync('background.js') && {
|
|
49
37
|
background: {
|
|
50
38
|
persistent: false,
|
|
51
39
|
scripts: ['browser-polyfill.js', 'background.js']
|
|
52
40
|
}
|
|
53
41
|
}),
|
|
54
|
-
...(_config = config, (
|
|
42
|
+
...(_config = config, pick(['permissions', 'browser_specific_settings'])(_config))
|
|
55
43
|
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
exports.default = _default;
|
|
59
|
-
module.exports = exports.default;
|
|
44
|
+
});
|
package/dist/dev.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _execa = _interopRequireDefault(require("execa"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
var _default = (target = 'firefox-desktop') => (0, _execa.default)('webpack-cli', ['--watch', '--config', require.resolve("./webpack.config")], {
|
|
13
|
-
env: {
|
|
14
|
-
WEB_EXT_TARGET: target
|
|
15
|
-
},
|
|
16
|
-
stdio: 'inherit'
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
exports.default = _default;
|
|
20
|
-
module.exports = exports.default;
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
import getWebpackConfig from "./get-webpack-config.js";
|
|
3
|
+
export default (config => (target = 'firefox-desktop') => {
|
|
4
|
+
process.env.WEB_EXT_TARGET = target;
|
|
5
|
+
return new Promise(() => webpack(getWebpackConfig(config)).watch({}, () => {}));
|
|
6
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import nodeEnv from 'better-node-env';
|
|
2
|
+
import CopyWebpackPlugin from 'copy-webpack-plugin';
|
|
3
|
+
import packageName from 'depcheck-package-name';
|
|
4
|
+
import EslintWebpackPlugin from 'eslint-webpack-plugin';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import { WebExtWebpackPlugin } from 'webext-webpack-plugin';
|
|
7
|
+
import WebpackBar from 'webpackbar';
|
|
8
|
+
import configToManifest from "./config-to-manifest.js";
|
|
9
|
+
export default (config => ({
|
|
10
|
+
devtool: false,
|
|
11
|
+
entry: {
|
|
12
|
+
...(fs.existsSync('background.js') && {
|
|
13
|
+
background: './background.js'
|
|
14
|
+
}),
|
|
15
|
+
...(fs.existsSync('content.js') && {
|
|
16
|
+
content: './content.js'
|
|
17
|
+
}),
|
|
18
|
+
...(fs.existsSync('options.js') && {
|
|
19
|
+
options: './options.js'
|
|
20
|
+
}),
|
|
21
|
+
...(fs.existsSync('popup.js') && {
|
|
22
|
+
popup: './popup.js'
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
mode: nodeEnv === 'production' ? nodeEnv : 'development',
|
|
26
|
+
module: {
|
|
27
|
+
rules: [{
|
|
28
|
+
test: /\.js$/,
|
|
29
|
+
use: {
|
|
30
|
+
loader: packageName`babel-loader`
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
test: /\.s[ac]ss$/i,
|
|
34
|
+
use: [packageName`raw-loader`, packageName`sass-loader`]
|
|
35
|
+
}]
|
|
36
|
+
},
|
|
37
|
+
output: {
|
|
38
|
+
clean: true
|
|
39
|
+
},
|
|
40
|
+
plugins: [new EslintWebpackPlugin({
|
|
41
|
+
failOnWarning: true,
|
|
42
|
+
fix: true
|
|
43
|
+
}), new WebpackBar(), new CopyWebpackPlugin({
|
|
44
|
+
patterns: [{
|
|
45
|
+
from: 'config.json',
|
|
46
|
+
to: 'manifest.json',
|
|
47
|
+
transform: configToManifest
|
|
48
|
+
}, {
|
|
49
|
+
from: require.resolve('webextension-polyfill')
|
|
50
|
+
}, {
|
|
51
|
+
from: 'assets',
|
|
52
|
+
noErrorOnMissing: true,
|
|
53
|
+
to: 'assets'
|
|
54
|
+
}, {
|
|
55
|
+
from: 'options.html',
|
|
56
|
+
noErrorOnMissing: true
|
|
57
|
+
}, {
|
|
58
|
+
from: 'popup.html',
|
|
59
|
+
noErrorOnMissing: true
|
|
60
|
+
}]
|
|
61
|
+
}), new WebExtWebpackPlugin({
|
|
62
|
+
build: {
|
|
63
|
+
artifactsDir: 'artifacts'
|
|
64
|
+
},
|
|
65
|
+
run: {
|
|
66
|
+
startUrl: config.startUrl,
|
|
67
|
+
target: process.env.WEB_EXT_TARGET
|
|
68
|
+
}
|
|
69
|
+
})]
|
|
70
|
+
}));
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _endent = _interopRequireDefault(require("@dword-design/functions/dist/endent"));
|
|
11
|
-
|
|
12
|
-
var _depcheckPackageName = _interopRequireDefault(require("depcheck-package-name"));
|
|
13
|
-
|
|
14
|
-
var _execa = _interopRequireDefault(require("execa"));
|
|
15
|
-
|
|
16
|
-
var _fsExtra = require("fs-extra");
|
|
17
|
-
|
|
18
|
-
var _baseConfig = _interopRequireDefault(require("./base-config"));
|
|
19
|
-
|
|
20
|
-
var _dev = _interopRequireDefault(require("./dev"));
|
|
21
|
-
|
|
22
|
-
var _lint = _interopRequireDefault(require("./lint"));
|
|
23
|
-
|
|
24
|
-
var _prepublishOnly = _interopRequireDefault(require("./prepublish-only"));
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
|
-
var _default = {
|
|
1
|
+
import depcheckParserSass from '@dword-design/depcheck-parser-sass';
|
|
2
|
+
import endent from "@dword-design/functions/dist/endent.js";
|
|
3
|
+
import packageName from 'depcheck-package-name';
|
|
4
|
+
import { execaCommand } from 'execa';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import dev from "./dev.js";
|
|
7
|
+
import lint from "./lint.js";
|
|
8
|
+
import prepublishOnly from "./prepublish-only.js";
|
|
9
|
+
export default (config => ({
|
|
29
10
|
allowedMatches: ['artifacts', 'assets', 'background.js', 'content.js', 'config.json', 'icon.png', 'index.spec.js', 'options.html', 'popup.html', 'options.js', 'popup.js', 'model'],
|
|
30
11
|
commands: {
|
|
31
12
|
dev: {
|
|
32
13
|
arguments: '[target]',
|
|
33
|
-
handler:
|
|
14
|
+
handler: dev(config)
|
|
34
15
|
},
|
|
35
|
-
prepublishOnly:
|
|
36
|
-
source: () =>
|
|
16
|
+
prepublishOnly: prepublishOnly(config),
|
|
17
|
+
source: () => execaCommand('git archive --output=source.zip HEAD')
|
|
37
18
|
},
|
|
38
19
|
depcheckConfig: {
|
|
39
20
|
parsers: {
|
|
40
|
-
'**/*.scss':
|
|
21
|
+
'**/*.scss': depcheckParserSass
|
|
41
22
|
}
|
|
42
23
|
},
|
|
43
24
|
deployAssets: [{
|
|
@@ -49,24 +30,24 @@ var _default = {
|
|
|
49
30
|
GOOGLE_CLIENT_SECRET: '${{ secrets.GOOGLE_CLIENT_SECRET }}',
|
|
50
31
|
GOOGLE_REFRESH_TOKEN: '${{ secrets.GOOGLE_REFRESH_TOKEN }}'
|
|
51
32
|
},
|
|
52
|
-
deployPlugins: [[
|
|
33
|
+
deployPlugins: [[packageName`@semantic-release/exec`, {
|
|
53
34
|
prepareCmd: 'yarn prepublishOnly'
|
|
54
|
-
}], [
|
|
35
|
+
}], [packageName`semantic-release-chrome`, {
|
|
55
36
|
asset: 'extension.zip',
|
|
56
|
-
extensionId:
|
|
37
|
+
extensionId: config.chromeExtensionId,
|
|
57
38
|
target: 'draft'
|
|
58
39
|
}]],
|
|
59
40
|
editorIgnore: ['.eslintrc.json', 'dist'],
|
|
60
41
|
gitignore: ['/.eslintrc.json', '/artifacts', '/dist', 'source.zip'],
|
|
61
42
|
isLockFileFixCommitType: true,
|
|
62
|
-
lint
|
|
63
|
-
prepare: () =>
|
|
64
|
-
extends:
|
|
43
|
+
lint,
|
|
44
|
+
prepare: () => fs.outputFile('.eslintrc.json', JSON.stringify({
|
|
45
|
+
extends: packageName`@dword-design/eslint-config`,
|
|
65
46
|
globals: {
|
|
66
47
|
browser: 'readonly'
|
|
67
48
|
}
|
|
68
49
|
}, undefined, 2)),
|
|
69
|
-
readmeInstallString:
|
|
50
|
+
readmeInstallString: endent`
|
|
70
51
|
## Recommended setup
|
|
71
52
|
* Node.js 12.16.0
|
|
72
53
|
* Yarn 1.21.1
|
|
@@ -92,6 +73,4 @@ var _default = {
|
|
|
92
73
|
$ yarn source
|
|
93
74
|
\`\`\`
|
|
94
75
|
`
|
|
95
|
-
};
|
|
96
|
-
exports.default = _default;
|
|
97
|
-
module.exports = exports.default;
|
|
76
|
+
}));
|
package/dist/lint.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _execa = _interopRequireDefault(require("execa"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
var _default = async () => {
|
|
1
|
+
import { execaCommand } from 'execa';
|
|
2
|
+
export default (async () => {
|
|
13
3
|
try {
|
|
14
|
-
await
|
|
4
|
+
await execaCommand('eslint --fix --ext .js,.json --ignore-path .gitignore .', {
|
|
15
5
|
all: true
|
|
16
6
|
});
|
|
17
7
|
} catch (error) {
|
|
18
8
|
throw new Error(error.all);
|
|
19
9
|
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.default = _default;
|
|
23
|
-
module.exports = exports.default;
|
|
10
|
+
});
|
package/dist/prepublish-only.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _default = () => (0, _execa.default)('webpack-cli', ['--config', require.resolve("./webpack.config")], {
|
|
13
|
-
stdio: 'inherit'
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
exports.default = _default;
|
|
17
|
-
module.exports = exports.default;
|
|
1
|
+
import webpack from 'webpack';
|
|
2
|
+
import getWebpackConfig from "./get-webpack-config.js";
|
|
3
|
+
export default (config => () => new Promise((resolve, reject) => webpack(getWebpackConfig(config), (error, stats) => {
|
|
4
|
+
if (error) {
|
|
5
|
+
return reject(error);
|
|
6
|
+
}
|
|
7
|
+
if (stats.hasErrors()) {
|
|
8
|
+
return reject(new Error(JSON.stringify(stats.toJson().errors, undefined, 2)));
|
|
9
|
+
}
|
|
10
|
+
return resolve();
|
|
11
|
+
})));
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dword-design/base-config-web-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"repository": "dword-design/base-config-web-extension",
|
|
5
5
|
"funding": "https://github.com/sponsors/dword-design",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Sebastian Landwehr <info@sebastianlandwehr.com>",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": "./dist/index.js",
|
|
8
10
|
"main": "dist/index.js",
|
|
9
11
|
"files": [
|
|
10
12
|
"dist"
|
|
@@ -12,6 +14,7 @@
|
|
|
12
14
|
"scripts": {
|
|
13
15
|
"checkUnknownFiles": "base checkUnknownFiles",
|
|
14
16
|
"commit": "base commit",
|
|
17
|
+
"depcheck": "base depcheck",
|
|
15
18
|
"dev": "base dev",
|
|
16
19
|
"lint": "base lint",
|
|
17
20
|
"prepare": "base prepare",
|
|
@@ -20,47 +23,42 @@
|
|
|
20
23
|
"test:raw": "base test:raw"
|
|
21
24
|
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"@dword-design/depcheck-parser-sass": "^
|
|
24
|
-
"@dword-design/eslint-config": "^
|
|
25
|
-
"@dword-design/functions": "^
|
|
26
|
-
"@semantic-release/exec": "^
|
|
27
|
-
"babel-loader": "^
|
|
26
|
+
"@dword-design/depcheck-parser-sass": "^4.0.4",
|
|
27
|
+
"@dword-design/eslint-config": "^5.0.1",
|
|
28
|
+
"@dword-design/functions": "^5.0.27",
|
|
29
|
+
"@semantic-release/exec": "^6.0.3",
|
|
30
|
+
"babel-loader": "^9.1.3",
|
|
28
31
|
"better-node-env": "^1.0.3",
|
|
29
|
-
"copy-webpack-plugin": "^
|
|
30
|
-
"depcheck-package-name": "^
|
|
31
|
-
"eslint-webpack-plugin": "^
|
|
32
|
-
"execa": "^
|
|
33
|
-
"fs-extra": "^
|
|
32
|
+
"copy-webpack-plugin": "^12.0.2",
|
|
33
|
+
"depcheck-package-name": "^3.0.1",
|
|
34
|
+
"eslint-webpack-plugin": "^4.0.1",
|
|
35
|
+
"execa": "^8.0.1",
|
|
36
|
+
"fs-extra": "^11.1.0",
|
|
34
37
|
"load-pkg": "^4.0.0",
|
|
35
|
-
"node-sass": "^
|
|
38
|
+
"node-sass": "^9.0.0",
|
|
36
39
|
"raw-loader": "^4.0.1",
|
|
37
|
-
"sass-loader": "^
|
|
40
|
+
"sass-loader": "^14.0.0",
|
|
38
41
|
"semantic-release-chrome": "dword-design/semantic-release-chrome#fork",
|
|
39
42
|
"webext-webpack-plugin": "^0.0.11",
|
|
40
|
-
"webextension-polyfill": "^0.
|
|
43
|
+
"webextension-polyfill": "^0.10.0",
|
|
41
44
|
"webpack": "^5.33.2",
|
|
42
|
-
"
|
|
43
|
-
"webpackbar": "^4.0.0"
|
|
45
|
+
"webpackbar": "^6.0.0"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@dword-design/base": "^
|
|
47
|
-
"@dword-design/puppeteer": "^
|
|
48
|
+
"@dword-design/base": "^11.0.2",
|
|
49
|
+
"@dword-design/puppeteer": "^7.0.0",
|
|
48
50
|
"@dword-design/tester": "^2.0.4",
|
|
49
51
|
"@dword-design/tester-plugin-tmp-dir": "^2.0.3",
|
|
50
52
|
"express": "^4.17.1",
|
|
51
|
-
"globby": "^
|
|
53
|
+
"globby": "^14.0.0",
|
|
52
54
|
"output-files": "^2.0.0",
|
|
53
|
-
"
|
|
54
|
-
"with-local-tmp-dir": "^4.0.0",
|
|
55
|
+
"with-local-tmp-dir": "^5.0.1",
|
|
55
56
|
"xvfb": "^0.4.0"
|
|
56
57
|
},
|
|
57
58
|
"engines": {
|
|
58
|
-
"node": ">=
|
|
59
|
+
"node": ">=18"
|
|
59
60
|
},
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
62
|
-
},
|
|
63
|
-
"baseConfig": {
|
|
64
|
-
"testInContainer": true
|
|
65
63
|
}
|
|
66
64
|
}
|
package/dist/base-config.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _loadPkg = _interopRequireDefault(require("load-pkg"));
|
|
9
|
-
|
|
10
|
-
var _loadPkg$sync;
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
const baseConfig = (_loadPkg$sync = _loadPkg.default.sync()) === null || _loadPkg$sync === void 0 ? void 0 : _loadPkg$sync.baseConfig;
|
|
15
|
-
|
|
16
|
-
var _default = typeof baseConfig === 'string' ? {} : baseConfig;
|
|
17
|
-
|
|
18
|
-
exports.default = _default;
|
|
19
|
-
module.exports = exports.default;
|
package/dist/webpack.config.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _betterNodeEnv = _interopRequireDefault(require("better-node-env"));
|
|
9
|
-
|
|
10
|
-
var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));
|
|
11
|
-
|
|
12
|
-
var _depcheckPackageName = _interopRequireDefault(require("depcheck-package-name"));
|
|
13
|
-
|
|
14
|
-
var _eslintWebpackPlugin = _interopRequireDefault(require("eslint-webpack-plugin"));
|
|
15
|
-
|
|
16
|
-
var _fsExtra = require("fs-extra");
|
|
17
|
-
|
|
18
|
-
var _webextWebpackPlugin = require("webext-webpack-plugin");
|
|
19
|
-
|
|
20
|
-
var _webpackbar = _interopRequireDefault(require("webpackbar"));
|
|
21
|
-
|
|
22
|
-
var _baseConfig = _interopRequireDefault(require("./base-config"));
|
|
23
|
-
|
|
24
|
-
var _configToManifest = _interopRequireDefault(require("./config-to-manifest"));
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
|
-
var _default = {
|
|
29
|
-
devtool: false,
|
|
30
|
-
entry: { ...((0, _fsExtra.existsSync)('background.js') && {
|
|
31
|
-
background: './background.js'
|
|
32
|
-
}),
|
|
33
|
-
...((0, _fsExtra.existsSync)('content.js') && {
|
|
34
|
-
content: './content.js'
|
|
35
|
-
}),
|
|
36
|
-
...((0, _fsExtra.existsSync)('options.js') && {
|
|
37
|
-
options: './options.js'
|
|
38
|
-
}),
|
|
39
|
-
...((0, _fsExtra.existsSync)('popup.js') && {
|
|
40
|
-
popup: './popup.js'
|
|
41
|
-
})
|
|
42
|
-
},
|
|
43
|
-
mode: _betterNodeEnv.default === 'production' ? _betterNodeEnv.default : 'development',
|
|
44
|
-
module: {
|
|
45
|
-
rules: [{
|
|
46
|
-
test: /\.js$/,
|
|
47
|
-
use: {
|
|
48
|
-
loader: (0, _depcheckPackageName.default)`babel-loader`
|
|
49
|
-
}
|
|
50
|
-
}, {
|
|
51
|
-
test: /\.s[ac]ss$/i,
|
|
52
|
-
use: [(0, _depcheckPackageName.default)`raw-loader`, (0, _depcheckPackageName.default)`sass-loader`]
|
|
53
|
-
}]
|
|
54
|
-
},
|
|
55
|
-
output: {
|
|
56
|
-
clean: true
|
|
57
|
-
},
|
|
58
|
-
plugins: [new _eslintWebpackPlugin.default({
|
|
59
|
-
failOnWarning: true,
|
|
60
|
-
fix: true
|
|
61
|
-
}), new _webpackbar.default(), new _copyWebpackPlugin.default({
|
|
62
|
-
patterns: [{
|
|
63
|
-
from: 'config.json',
|
|
64
|
-
to: 'manifest.json',
|
|
65
|
-
transform: _configToManifest.default
|
|
66
|
-
}, {
|
|
67
|
-
from: require.resolve('webextension-polyfill')
|
|
68
|
-
}, {
|
|
69
|
-
from: 'assets',
|
|
70
|
-
noErrorOnMissing: true,
|
|
71
|
-
to: 'assets'
|
|
72
|
-
}, {
|
|
73
|
-
from: 'options.html',
|
|
74
|
-
noErrorOnMissing: true
|
|
75
|
-
}, {
|
|
76
|
-
from: 'popup.html',
|
|
77
|
-
noErrorOnMissing: true
|
|
78
|
-
}]
|
|
79
|
-
}), new _webextWebpackPlugin.WebExtWebpackPlugin({
|
|
80
|
-
build: {
|
|
81
|
-
artifactsDir: 'artifacts'
|
|
82
|
-
},
|
|
83
|
-
run: {
|
|
84
|
-
startUrl: _baseConfig.default.startUrl,
|
|
85
|
-
target: process.env.WEB_EXT_TARGET
|
|
86
|
-
}
|
|
87
|
-
})]
|
|
88
|
-
};
|
|
89
|
-
exports.default = _default;
|
|
90
|
-
module.exports = exports.default;
|