/* 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'); const isProd = process.env.NODE_ENV === 'production'; module.exports = { apiPath: 'stubs/api', apps: { main: { 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: [ // Главная страница (с 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', }), ], }, navigations: {}, features: {}, config: {}, };