mirror of
https://github.com/imjasonh/apkviz
synced 2026-07-08 01:45:15 +00:00
- Add GitHub Actions workflow to build and deploy on push to main - Configure webpack for production builds with correct base path - Add CopyWebpackPlugin to copy APKINDEX file to dist - Update data fetcher to handle GitHub Pages base path - Clean dist directory on build for fresh deployments The site will be automatically deployed to https://imjasonh.github.io/apkviz/ whenever changes are pushed to the main branch. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
51 lines
No EOL
1.1 KiB
JavaScript
51 lines
No EOL
1.1 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
|
module.exports = (env, argv) => {
|
|
const isProduction = argv.mode === 'production';
|
|
|
|
return {
|
|
entry: './src/index.ts',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader'],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
output: {
|
|
filename: 'bundle.js',
|
|
path: path.resolve(__dirname, 'dist'),
|
|
clean: true,
|
|
publicPath: isProduction ? '/apkviz/' : '/',
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/index.html',
|
|
}),
|
|
new CopyWebpackPlugin({
|
|
patterns: [
|
|
{ from: 'public', to: '.' }
|
|
],
|
|
}),
|
|
],
|
|
devServer: {
|
|
static: [
|
|
{ directory: path.join(__dirname, 'dist') },
|
|
{ directory: path.join(__dirname, 'public') }
|
|
],
|
|
hot: true,
|
|
open: true,
|
|
},
|
|
};
|
|
}; |