Files
cypress/packages/reporter/webpack.config.ts
Bill Glesias f1454dd0d1 chore: upgrade webpack dependencies to latest v4 compatible (#27396)
* chore: upgrade webpack dependencies to latest sub 5 compat [run ci]

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: build binaries [run ci]

* chore: update snapshot for darwin

* chore: downgrade tsconfig-paths-webpack-loader from v4 to v3 [run ci]

* [run ci]

* chore: add rimraf in @packages/runner to use in prebuild command to clear out dist directory to get windows compat [run ci]

* don't pass -rf flags into rimraf as it is inherit with the command

---------

Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
2023-07-31 14:19:11 -04:00

43 lines
1.1 KiB
TypeScript

import { getCommonConfig, HtmlWebpackPlugin, getCleanWebpackPlugin } from '@packages/web-config/webpack.config.base'
import path from 'path'
import type { Configuration } from 'webpack'
const CleanWebpackPlugin = getCleanWebpackPlugin()
// @ts-ignore
const config: Configuration = {
...getCommonConfig(),
entry: {
reporter: [path.resolve(__dirname, 'src')],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
devtoolModuleFilenameTemplate: 'cypress://[namespace]/[resource-path]',
},
}
// @ts-ignore
config.plugins = [
// @ts-ignore
...config.plugins,
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'static/index.html'),
inject: false,
}),
new CleanWebpackPlugin({ cleanStaleWebpackAssets: false }),
]
config.resolve = {
...config.resolve,
alias: {
'lodash': require.resolve('lodash'),
'mobx': require.resolve('mobx'),
'mobx-react': require.resolve('mobx-react'),
'react': require.resolve('react'),
'react-dom': require.resolve('react-dom'),
},
}
export default config