Skip to content

Commit a2b64a3

Browse files
Merge branch 'v2'
2 parents 1d41e73 + a54bdeb commit a2b64a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+35572
-31586
lines changed

.editorconfig

Lines changed: 0 additions & 12 deletions
This file was deleted.

.erb/configs/.eslintrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"rules": {
3-
"no-console": "off",
4-
"global-require": "off",
5-
"import/no-dynamic-require": "off"
6-
}
2+
"rules": {
3+
"no-console": "off",
4+
"global-require": "off",
5+
"import/no-dynamic-require": "off"
6+
}
77
}

.erb/configs/webpack.config.base.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,47 @@ import webpackPaths from './webpack.paths';
77
import { dependencies as externals } from '../../release/app/package.json';
88

99
const configuration: webpack.Configuration = {
10-
externals: [...Object.keys(externals || {})],
11-
12-
stats: 'errors-only',
13-
14-
module: {
15-
rules: [
16-
{
17-
test: /\.[jt]sx?$/,
18-
exclude: /node_modules/,
19-
use: {
20-
loader: 'ts-loader',
21-
options: {
22-
// Remove this line to enable type checking in webpack builds
23-
transpileOnly: true,
24-
},
10+
externals: [...Object.keys(externals || {})],
11+
12+
stats: 'errors-only',
13+
14+
module: {
15+
rules: [
16+
{
17+
test: /\.[jt]sx?$/,
18+
exclude: /node_modules/,
19+
use: {
20+
loader: 'ts-loader',
21+
options: {
22+
// Remove this line to enable type checking in webpack builds
23+
transpileOnly: true,
24+
},
25+
},
26+
},
27+
],
28+
},
29+
30+
output: {
31+
path: webpackPaths.srcPath,
32+
// https://github.com/webpack/webpack/issues/1114
33+
library: {
34+
type: 'commonjs2',
2535
},
26-
},
27-
],
28-
},
36+
},
2937

30-
output: {
31-
path: webpackPaths.srcPath,
32-
// https://github.com/webpack/webpack/issues/1114
33-
library: {
34-
type: 'commonjs2',
38+
/**
39+
* Determine the array of extensions that should be used to resolve modules.
40+
*/
41+
resolve: {
42+
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
43+
modules: [webpackPaths.srcPath, 'node_modules'],
3544
},
36-
},
37-
38-
/**
39-
* Determine the array of extensions that should be used to resolve modules.
40-
*/
41-
resolve: {
42-
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
43-
modules: [webpackPaths.srcPath, 'node_modules'],
44-
},
45-
46-
plugins: [
47-
new webpack.EnvironmentPlugin({
48-
NODE_ENV: 'production',
49-
}),
50-
],
45+
46+
plugins: [
47+
new webpack.EnvironmentPlugin({
48+
NODE_ENV: 'production',
49+
}),
50+
],
5151
};
5252

5353
export default configuration;

.erb/configs/webpack.config.main.prod.ts

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,67 +16,72 @@ checkNodeEnv('production');
1616
deleteSourceMaps();
1717

1818
const devtoolsConfig =
19-
process.env.DEBUG_PROD === 'true'
20-
? {
21-
devtool: 'source-map',
22-
}
23-
: {};
19+
process.env.DEBUG_PROD === 'true'
20+
? {
21+
devtool: 'source-map',
22+
}
23+
: {};
2424

2525
const configuration: webpack.Configuration = {
26-
...devtoolsConfig,
26+
...devtoolsConfig,
2727

28-
mode: 'production',
28+
mode: 'production',
2929

30-
target: 'electron-main',
30+
target: 'electron-main',
3131

32-
entry: {
33-
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
34-
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'),
35-
},
32+
entry: {
33+
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
34+
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'),
35+
},
3636

37-
output: {
38-
path: webpackPaths.distMainPath,
39-
filename: '[name].js',
40-
},
37+
output: {
38+
path: webpackPaths.distMainPath,
39+
filename: '[name].js',
40+
},
4141

42-
optimization: {
43-
minimizer: [
44-
new TerserPlugin({
45-
parallel: true,
46-
}),
47-
],
48-
},
42+
optimization: {
43+
minimizer: [
44+
new TerserPlugin({
45+
parallel: true,
46+
}),
47+
],
48+
},
49+
50+
plugins: [
51+
new BundleAnalyzerPlugin({
52+
analyzerMode:
53+
process.env.ANALYZE === 'true' ? 'server' : 'disabled',
54+
}),
4955

50-
plugins: [
51-
new BundleAnalyzerPlugin({
52-
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
53-
}),
56+
/**
57+
* Create global constants which can be configured at compile time.
58+
*
59+
* Useful for allowing different behaviour between development builds and
60+
* release builds
61+
*
62+
* NODE_ENV should be production so that modules do not perform certain
63+
* development checks
64+
*/
65+
new webpack.DefinePlugin({
66+
'process.env.FLUENTFFMPEG_COV': false
67+
}),
68+
69+
new webpack.EnvironmentPlugin({
70+
NODE_ENV: 'production',
71+
DEBUG_PROD: false,
72+
START_MINIMIZED: false,
73+
}),
74+
],
5475

5576
/**
56-
* Create global constants which can be configured at compile time.
57-
*
58-
* Useful for allowing different behaviour between development builds and
59-
* release builds
60-
*
61-
* NODE_ENV should be production so that modules do not perform certain
62-
* development checks
77+
* Disables webpack processing of __dirname and __filename.
78+
* If you run the bundle in node.js it falls back to these values of node.js.
79+
* https://github.com/webpack/webpack/issues/2010
6380
*/
64-
new webpack.EnvironmentPlugin({
65-
NODE_ENV: 'production',
66-
DEBUG_PROD: false,
67-
START_MINIMIZED: false,
68-
}),
69-
],
70-
71-
/**
72-
* Disables webpack processing of __dirname and __filename.
73-
* If you run the bundle in node.js it falls back to these values of node.js.
74-
* https://github.com/webpack/webpack/issues/2010
75-
*/
76-
node: {
77-
__dirname: false,
78-
__filename: false,
79-
},
81+
node: {
82+
__dirname: false,
83+
__filename: false,
84+
},
8085
};
8186

8287
export default merge(baseConfig, configuration);

.erb/configs/webpack.config.preload.dev.ts

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,65 @@ import checkNodeEnv from '../scripts/check-node-env';
99
// When an ESLint server is running, we can't set the NODE_ENV so we'll check if it's
1010
// at the dev webpack config is not accidentally run in a production environment
1111
if (process.env.NODE_ENV === 'production') {
12-
checkNodeEnv('development');
12+
checkNodeEnv('development');
1313
}
1414

1515
const configuration: webpack.Configuration = {
16-
devtool: 'inline-source-map',
16+
devtool: 'inline-source-map',
1717

18-
mode: 'development',
18+
mode: 'development',
1919

20-
target: 'electron-preload',
20+
target: 'electron-preload',
2121

22-
entry: path.join(webpackPaths.srcMainPath, 'preload.ts'),
22+
entry: path.join(webpackPaths.srcMainPath, 'preload.ts'),
2323

24-
output: {
25-
path: webpackPaths.dllPath,
26-
filename: 'preload.js',
27-
},
24+
output: {
25+
path: webpackPaths.dllPath,
26+
filename: 'preload.js',
27+
},
2828

29-
plugins: [
30-
new BundleAnalyzerPlugin({
31-
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
32-
}),
29+
plugins: [
30+
new BundleAnalyzerPlugin({
31+
analyzerMode:
32+
process.env.ANALYZE === 'true' ? 'server' : 'disabled',
33+
}),
3334

34-
/**
35-
* Create global constants which can be configured at compile time.
36-
*
37-
* Useful for allowing different behaviour between development builds and
38-
* release builds
39-
*
40-
* NODE_ENV should be production so that modules do not perform certain
41-
* development checks
42-
*
43-
* By default, use 'development' as NODE_ENV. This can be overriden with
44-
* 'staging', for example, by changing the ENV variables in the npm scripts
45-
*/
46-
new webpack.EnvironmentPlugin({
47-
NODE_ENV: 'development',
48-
}),
35+
/**
36+
* Create global constants which can be configured at compile time.
37+
*
38+
* Useful for allowing different behaviour between development builds and
39+
* release builds
40+
*
41+
* NODE_ENV should be production so that modules do not perform certain
42+
* development checks
43+
*
44+
* By default, use 'development' as NODE_ENV. This can be overriden with
45+
* 'staging', for example, by changing the ENV variables in the npm scripts
46+
*/
47+
new webpack.DefinePlugin({
48+
'process.env.FLUENTFFMPEG_COV': false
49+
}),
50+
51+
new webpack.EnvironmentPlugin({
52+
NODE_ENV: 'development',
53+
}),
4954

50-
new webpack.LoaderOptionsPlugin({
51-
debug: true,
52-
}),
53-
],
55+
new webpack.LoaderOptionsPlugin({
56+
debug: true,
57+
}),
58+
],
5459

55-
/**
56-
* Disables webpack processing of __dirname and __filename.
57-
* If you run the bundle in node.js it falls back to these values of node.js.
58-
* https://github.com/webpack/webpack/issues/2010
59-
*/
60-
node: {
61-
__dirname: false,
62-
__filename: false,
63-
},
60+
/**
61+
* Disables webpack processing of __dirname and __filename.
62+
* If you run the bundle in node.js it falls back to these values of node.js.
63+
* https://github.com/webpack/webpack/issues/2010
64+
*/
65+
node: {
66+
__dirname: false,
67+
__filename: false,
68+
},
6469

65-
watch: true,
70+
watch: true,
6671
};
6772

6873
export default merge(baseConfig, configuration);

0 commit comments

Comments
 (0)