Skip to content

Commit

Permalink
feat: configure GitHub Pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrad77 committed Dec 15, 2024
1 parent 7a4b659 commit d8ef477
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .erb/configs/webpack.config.web.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';
import { merge } from 'webpack-merge';
import baseConfig from './webpack.config.base';
import webpackPaths from './webpack.paths';

const configuration: webpack.Configuration = {
devtool: 'source-map',
mode: 'production',
target: ['web'],
entry: path.join(webpackPaths.srcRendererPath, 'index.tsx'),
output: {
path: path.resolve(__dirname, '../../dist-web'),
publicPath: '/',
filename: '[name].[contenthash].js',
clean: true,
},
module: {
rules: [
{
test: /\.s?(a|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
'postcss-loader',
],
},
{
test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|eot|ttf|otf|mp4)$/i,
type: 'asset/resource',
},
],
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
},
plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
}),
new HtmlWebpackPlugin({
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
minify: {
collapseWhitespace: true,
removeComments: true,
removeAttributeQuotes: true,
},
}),
],
};

export default merge(baseConfig, configuration);
Binary file added dist-web/948d314501934d26221c.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions dist-web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=Content-Security-Policy content="script-src 'self' 'unsafe-inline'"><title>Theater VFX</title><script defer=defer src=/main.4f168f609f6d8474604b.js></script><link href=/main.2bcd8bce5587eb107940.css rel=stylesheet></head><body><div id=root></div></body></html>
2 changes: 2 additions & 0 deletions dist-web/main.2bcd8bce5587eb107940.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist-web/main.2bcd8bce5587eb107940.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist-web/main.4f168f609f6d8474604b.js

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions dist-web/main.4f168f609f6d8474604b.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/**
* @remix-run/router v1.19.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

/**
* React Router v6.26.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
1 change: 1 addition & 0 deletions dist-web/main.4f168f609f6d8474604b.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"start:main": "concurrently -k \"cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --watch --config ./.erb/configs/webpack.config.main.dev.ts\" \"electronmon .\"",
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
"build:web": "cross-env NODE_ENV=production webpack --config ./.erb/configs/webpack.config.web.ts",
"serve:web": "npx serve dist-web",
"deploy:web": "npm run build:web && gh-pages -d dist-web",
"test": "jest"
},
"browserslist": [
Expand Down

0 comments on commit d8ef477

Please sign in to comment.