Refactor webpack configuration to include multiple entry points for index and terms pages. Remove SSR script and update package dependencies for improved build process. Add terms.html as a static page with appropriate styles and metadata.
platform/bro-js/bro.landing/pipeline/head This commit looks good

This commit is contained in:
Primakov Alexandr Alexandrovich
2025-10-24 13:23:31 +03:00
parent 3b997a18e2
commit 6e55a331cb
8 changed files with 324 additions and 2397 deletions
+19 -2
View File
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable no-undef */
const path = require('path');
const pkg = require('./package');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
@@ -13,15 +14,31 @@ module.exports = {
version: 'master',
name: 'cleanName',
},
},
},
webpackConfig: {
entry: {
index: './src/index.tsx',
// terms страница не нужен JS, только HTML
},
output: {
publicPath: isProd
? 'https://static.brojs.ru/landing/main/'
: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`,
filename: '[name].js?[contenthash]',
},
plugins: [
new HtmlWebpackPlugin({}),
// Главная страница (с React)
new HtmlWebpackPlugin({
template: './src/index.ejs',
filename: 'index.html',
chunks: ['index'],
}),
// Terms страница (чистый HTML без JS)
new HtmlWebpackPlugin({
template: './src/terms.html',
filename: 'terms.html',
inject: false, // Не инжектим JS
}),
new webpack.DefinePlugin({
IS_PROD: process.env.NODE_ENV === 'production',
}),