how to add file.html and file2.js to webpack build using config-overrides if these files are in 'public' folder

Viewed 8

I want to transfer data from .env to file.html, and insert the %URL% parameter into the crc, so I think that I need to add these files to the webpack build

here is my config-overrides.js

const {override, fixBabelImports, addLessLoader, disableEsLint, addWebpackResolve, addDecoratorsLegacy, enableEslintTypescript,
    addWebpackModuleRule,
    useBabelRc
} = require('customize-cra');

module.exports = override(
       useBabelRc(),

    addLessLoader({
        lessOptions: {
            javascriptEnabled: true,
            modifyVars: { '@primary-color': '#A80000' },
        },
    }),

    fixBabelImports('import', {
        libraryName: 'antd',
        libraryDirectory: 'es',
        style: true,
    }),

    addWebpackModuleRule({
        test: /\.(tsx|js|ts)x?$/,
        use: {
            loader: 'babel-loader',
        },
        resolve: {
            fullySpecified: false
        }
    }),
    

    addWebpackResolve({
        extensions: ['.web.js', '.web.jsx', '.jsx', '.tsx', '.ts', '.js', '.mjs', '.json'],
        fullySpecified: false,
    })
)

0 Answers
Related