-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig-overrides.js
76 lines (75 loc) · 2.1 KB
/
config-overrides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const FileManagerPlugin = require('filemanager-webpack-plugin');
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
const {
addWebpackPlugin,
override,
disableChunk,
adjustStyleLoaders,
} = require('customize-cra');
const packageJson = require('./package.json');
module.exports = {
webpack: override(
(config) => {
config.output.filename = 'js/bundle.js';
config.optimization.minimize = false;
config.ignoreWarnings = [/Failed to parse source map/];
return config;
},
adjustStyleLoaders(({ use }) => {
const styleLoader = use[0].loader.replace(
'mini-css-extract-plugin/dist/loader.js',
'style-loader',
);
use[0] = styleLoader;
}),
disableChunk(),
addWebpackPlugin(
new FileManagerPlugin({
events: {
onEnd: {
archive: [
{
source: './build',
destination: './build/extension.zip',
},
],
},
},
}),
),
addWebpackPlugin(
new WebpackManifestPlugin({
generate(_, files) {
return {
manifest_version: 3,
name: 'Brokalys: ss.lv historical prices',
description: packageJson.description,
homepage_url: 'https://brokalys.com',
version: packageJson.version,
icons: {
512: 'favicon.png',
},
action: {
default_icon: 'favicon.png',
},
content_scripts: [
{
matches: [
'https://www.ss.lv/msg/*/real-estate/*',
'https://www.ss.com/msg/*/real-estate/*',
'https://www.city24.lv/real-estate/*',
'https://www.city24.lv/*/real-estate/*',
],
js: files
.filter(({ isInitial }) => isInitial)
.map(({ path }) => path),
run_at: 'document_idle',
},
],
author: packageJson.author,
};
},
}),
),
),
};