I'm using CRA with CRACO to add another entry file to webpack configuration.
Here is the code:
module.exports = {
webpack: {
configure: (webpackConfig, {paths}) => {
return {
...webpackConfig,
entry: {
main: paths.appIndexJs,
content: './src/chromeServices/DOMEvaluator.ts',
},
}
},
},
}
However I don't need this file to be injected into the HTML file, is that possible to do so?
It is very easy to do so. CRACO and ultimately CRA make use of
html-webpack-pluginto generate your HTML file and add the requiredscripttags. You will have to make use of chunk filtering to achieve this.