diff --git a/nym-wallet/package.json b/nym-wallet/package.json index 82387a5ff2..e967098aa6 100644 --- a/nym-wallet/package.json +++ b/nym-wallet/package.json @@ -6,10 +6,11 @@ "scripts": { "webpack:dev": "yarn webpack serve", "webpack:build": "yarn webpack", + "webpack:prod": "yarn webpack --progress --config webpack.prod.config.js", "tauri:dev": "yarn tauri dev", "tauri:build": "yarn tauri build", - "dev": "yarn run webpack:dev & yarn run tauri:dev", - "build": "yarn run webpack:build & yarn run tauri:build" + "dev": "yarn run-s webpack:dev tauri:dev", + "build:prod": "run-s webpack:prodbuild tauri:build" }, "dependencies": { "@babel/preset-typescript": "^7.15.0", @@ -44,9 +45,11 @@ "@types/semver": "^7.3.8", "babel-loader": "^8.2.2", "css-loader": "^6.2.0", + "favicons": "^6.2.2", "favicons-webpack-plugin": "^5.0.2", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.3.2", + "npm-run-all": "^4.1.5", "style-loader": "^3.2.1", "url-loader": "^4.1.1", "webpack": "^5.64.3", diff --git a/nym-wallet/public/favicon.png b/nym-wallet/public/favicon.png new file mode 100644 index 0000000000..fcf1e747d0 Binary files /dev/null and b/nym-wallet/public/favicon.png differ diff --git a/nym-wallet/webpack.prod.config.js b/nym-wallet/webpack.prod.config.js new file mode 100644 index 0000000000..a9b423fa53 --- /dev/null +++ b/nym-wallet/webpack.prod.config.js @@ -0,0 +1,42 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin') +const FaviconsWebpackPlugin = require('favicons-webpack-plugin') +var path = require('path') + +module.exports = { + mode: 'production', + node: { + __dirname: false + }, + entry: path.resolve(__dirname, '/src/index'), + plugins: [ + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, 'public/index.html'), + filename: 'index.html', + }), + new FaviconsWebpackPlugin(path.resolve(__dirname, 'public/favicon.png')), + ], + module: { + rules: [ + { + test: /\.(ts|tsx)$/, + exclude: /node_modules/, + use: ['babel-loader'], + }, + { + test: /\.css$/i, + use: ['style-loader', 'css-loader'], + }, + { + test: /\.(png|jpe?g|gif|svg)$/i, + use: [ + { + loader: 'file-loader', + }, + ], + }, + ], + }, + resolve: { + extensions: ['*', '.js', '.jsx', '.ts', '.tsx'], + }, +} \ No newline at end of file