Skip to content

Commit 7b2c5e7

Browse files
committed
UPDATED: version number
ADDED: clean up the dist/ directory before generation production builds
1 parent 2c90eb5 commit 7b2c5e7

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

package-lock.json

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"@types/react-virtualized": "^9.18.12",
5252
"awesome-typescript-loader": "^5.2.1",
5353
"aws-sdk": "^2.332.0",
54+
"clean-webpack-plugin": "^2.0.2",
5455
"copy-webpack-plugin": "^5.0.3",
5556
"css-loader": "^1.0.0",
5657
"electron": "^3.0.5",
@@ -90,4 +91,4 @@
9091
"react-i18next": "^8.4.0",
9192
"react-virtualized": "^9.21.0"
9293
}
93-
}
94+
}

webpack.config.production.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const HtmlWebpackPlugin = require('html-webpack-plugin');
3+
const CleanWebpackPlugin = require('clean-webpack-plugin');
34
const CopyPlugin = require('copy-webpack-plugin');
45
const webpack = require('webpack');
56
const packageJson = require('./package.json');
@@ -77,12 +78,18 @@ module.exports = [
7778
target: 'electron-main',
7879
entry: { main: './src/electron/main.ts' },
7980
plugins: [
81+
new CleanWebpackPlugin({
82+
cleanOnceBeforeBuildPatterns: [path.join(process.cwd(), 'dist/**/*')],
83+
dangerouslyAllowCleanPatternsOutsideProject: true,
84+
dry: false
85+
}),
8086
new webpack.DefinePlugin({
8187
'ENV.CY': false,
8288
'ENV.NODE_ENV': JSON.stringify(baseConfig.mode),
8389
'ENV.VERSION': JSON.stringify(packageJson.version),
8490
'ENV.HASH': JSON.stringify(gitHash)
85-
})
91+
},
92+
)
8693
]
8794
},
8895
baseConfig),

0 commit comments

Comments
 (0)