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
platform/bro-js/bro.landing/pipeline/head This commit looks good
This commit is contained in:
+19
-2
@@ -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',
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user