Files
cypress/packages/runner/webpack.config.ts
T
Chris Breiding c4cbb15be9 Update browser icons (#6230)
* fix images in runner

* fix webpack not liking resolve: lodash + lodash/fp

* fix mobx deprecation warnings

* use real images for browser icons

* revert runs.json fixture

was only using changed values for screenshot purposes

* vertically and horizontally align browser icons in nav dropdown.

* Add edge browsers to fixture

* Add tests and icon support for Edge and Firefox variation browsers

* Fix icons resolution for retina displays

- make tests less strict to changes in icon size or extension

* Address situation where user was undefined in test runs.

* Fix vertical alignment of icons in runs list + add more icons to fixture

* Fix size of browser-icons in automation error page

* try not using nodeVersion: system

* try removing webpack resolve values

* put back webpack resolve values

* derp

* add tests for browser icon

* add support for firefox dev edition, firefox nightly, and edge canary

* add edge beta, edge dev, and family fallback

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
2020-01-27 23:10:26 +06:30

64 lines
1.3 KiB
TypeScript

import _ from 'lodash'
import commonConfig, { HtmlWebpackPlugin } from '@packages/web-config/webpack.config.base'
import path from 'path'
let pngRule
// @ts-ignore
const nonPngRules = _.filter(commonConfig.module.rules, (rule) => {
// @ts-ignore
if (rule.test.toString().includes('png')) {
pngRule = rule
return false
}
return true
})
pngRule.use[0].options = {
name: '[name].[ext]',
outputPath: 'img',
publicPath: '/__cypress/runner/img/',
}
const config: typeof commonConfig = {
...commonConfig,
module: {
rules: [
...nonPngRules,
pngRule,
],
},
entry: {
cypress_runner: [path.resolve(__dirname, 'src/index.js')],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
}
// @ts-ignore
config.plugins = [
// @ts-ignore
...config.plugins,
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './static/index.html'),
inject: false,
}),
]
config.resolve = {
...config.resolve,
alias: {
'bluebird': require.resolve('bluebird'),
'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