Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to webpack 5, frontend-components-config 4, patternfly current (…
…ansible#742) * package.json: sort .scripts many scripts now, sort by name no other changes * package.json: update dependencies, devDependencies the point is to update to webpack5, but it depends on and is depended on by redhat cloud services and patternfly needs new webpack, while new sass needs new patternfly and webpack needs loaders the rest is minor (not updating husky - newer versions don't autoinstall) * webbpackConfig.serve -> webpackConfig.devServer * fonts: use type: asset/resource instead of file-loader * @redhat-cloud-services/frontend-components*: fix import paths * add missing style-loader used in production * switch style-loader and mini-css-extract-plugin around style-loader: css ends up in js bundles, about 2x as big takes about half the time to run mini-css-extract-plugin: css ends up in dist/css, about half the size takes about 2x longer given that, we care more about size in production and more about speed in development, switching around :) + ensure only css, sass and scss are treated as css-like * .babelrc: add typescript plugin, use for .js, .jsx, .ts, .tsx lingui relies on babel to transform the code, so we need babel to understand typescript this also allows us to use proper typescript as a linter, independent of the compiler and it speeds up the dev build by a factor of ~2 also removed plugin-proposal-object-rest-spread and plugin-proposal-class-properties as they are part of preset-env now * webpack watchOptions: ignore vim swapfiles when watching * get_human_size: unmark string, fixed in ansible#810 babel uses a different compile order and get_human_size.ts and paths.ts are 2 files which need _ at module load time 810 adds the lingui helper, so, this is just temporary * package.json: add lint:ts, runs tsc; add skipLibCheck skipLibCheck typescript config is needed because typescript fails on 89 node_modules/@types/webpack/index.d.ts errors seems to be a conflict between new typescript (4.3.5, current) and old @types/webpack, temporary problem because it's a dep of frontend-components-config └─┬ @redhat-cloud-services/frontend-components-config@4.3.3 └─┬ clean-webpack-plugin@3.0.0 └── @types/webpack@4.41.30 * remove devServer override, the original works better in dev handles index redirect and publicPath and thus no need for common.webpack, as the last import was the path * add fork-ts-checker-webpack-plugin https://github.com/TypeStrong/fork-ts-checker-webpack-plugin the plugin runs typescript for type checking during the compilation, it's not fatal in development (changes will apply despite the errors), it is fatal in production (dist/ won't get emitted when there are errors) (cherry picked from commit 9f88cbc)
- Loading branch information