Skip to content

🎥 Make videos programmatically with React

remove react app extras

Jonny Burger89fd9c5847a0
diff --git a/packages/player-example/config/env.js b/packages/player-example/config/env.js
deleted file mode 100644
index ffa7e496aa..0000000000
--- a/packages/player-example/config/env.js
+++ /dev/null
@@ -1,104 +0,0 @@
-'use strict';
-
-const fs = require('fs');
-const path = require('path');
-const paths = require('./paths');
-
-// Make sure that including paths.js after env.js will read .env variables.
-delete require.cache[require.resolve('./paths')];
-
-const NODE_ENV = process.env.NODE_ENV;
-if (!NODE_ENV) {
- throw new Error(
- 'The NODE_ENV environment variable is required but was not specified.'
- );
-}
-
-// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
-const dotenvFiles = [
- `${paths.dotenv}.${NODE_ENV}.local`,
- // Don't include `.env.local` for `test` environment
- // since normally you expect tests to produce the same
- // results for everyone
- NODE_ENV !== 'test' && `${paths.dotenv}.local`,
- `${paths.dotenv}.${NODE_ENV}`,
- paths.dotenv,
-].filter(Boolean);
-
-// Load environment variables from .env* files. Suppress warnings using silent
-// if this file is missing. dotenv will never modify any environment variables
-// that have already been set. Variable expansion is supported in .env files.
-// https://github.com/motdotla/dotenv
-// https://github.com/motdotla/dotenv-expand
-dotenvFiles.forEach(dotenvFile => {
- if (fs.existsSync(dotenvFile)) {
- require('dotenv-expand')(
- require('dotenv').config({
- path: dotenvFile,
- })
- );
- }
-});
-
-// We support resolving modules according to `NODE_PATH`.
-// This lets you use absolute paths in imports inside large monorepos:
-// https://github.com/facebook/create-react-app/issues/253.
-// It works similar to `NODE_PATH` in Node itself:
-// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
-// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
-// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
-// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
-// We also resolve them to make sure all tools using them work consistently.
-const appDirectory = fs.realpathSync(process.cwd());
-process.env.NODE_PATH = (process.env.NODE_PATH || '')
- .split(path.delimiter)
- .filter(folder => folder && !path.isAbsolute(folder))
- .map(folder => path.resolve(appDirectory, folder))
- .join(path.delimiter);
-
-// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
-// injected into the application via DefinePlugin in webpack configuration.
-const REACT_APP = /^REACT_APP_/i;
-
-function getClientEnvironment(publicUrl) {
- const raw = Object.keys(process.env)
- .filter(key => REACT_APP.test(key))
- .reduce(
- (env, key) => {
- env[key] = process.env[key];
- return env;
- },
- {
- // Useful for determining whether we’re running in production mode.
- // Most importantly, it switches React into the correct mode.
- NODE_ENV: process.env.NODE_ENV || 'development',
- // Useful for resolving the correct path to static assets in `public`.
- // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
- // This should only be used as an escape hatch. Normally you would put
- // images into the `src` and `import` them in code to get their paths.
- PUBLIC_URL: publicUrl,
- // We support configuring the sockjs pathname during development.
- // These settings let a developer run multiple simultaneous projects.
- // They are used as the connection `hostname`, `pathname` and `port`
- // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
- // and `sockPort` options in webpack-dev-server.
- WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
- WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
- WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
- // Whether or not react-refresh is enabled.
- // It is defined here so it is available in the webpackHotDevClient.
- FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
- }
- );
- // Stringify all values so we can feed into webpack DefinePlugin
- const stringified = {
- 'process.env': Object.keys(raw).reduce((env, key) => {
- env[key] = JSON.stringify(raw[key]);
- return env;
- }, {}),
- };
-
- return { raw, stringified };
-}
-
-module.exports = getClientEnvironment;
diff --git a/packages/player-example/config/jest/babelTransform.js b/packages/player-example/config/jest/babelTransform.js
deleted file mode 100644
index 5b391e4055..0000000000
--- a/packages/player-example/config/jest/babelTransform.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-const babelJest = require('babel-jest').default;
-
-const hasJsxRuntime = (() => {
- if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
- return false;
- }
-
- try {
- require.resolve('react/jsx-runtime');
- return true;
- } catch (e) {
- return false;
- }
-})();
-
-module.exports = babelJest.createTransformer({
- presets: [
- [
- require.resolve('babel-preset-react-app'),
- {
- runtime: hasJsxRuntime ? 'automatic' : 'classic',
- },
- ],
- ],
- babelrc: false,
- configFile: false,
-});
diff --git a/packages/player-example/config/jest/cssTransform.js b/packages/player-example/config/jest/cssTransform.js
deleted file mode 100644
index 8f65114812..0000000000
--- a/packages/player-example/config/jest/cssTransform.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-// This is a custom Jest transformer turning style imports into empty objects.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process() {
- return 'module.exports = {};';
- },
- getCacheKey() {
- // The output is always the same.
- return 'cssTransform';
- },
-};
diff --git a/packages/player-example/config/jest/fileTransform.js b/packages/player-example/config/jest/fileTransform.js
deleted file mode 100644
index aab67618c3..0000000000
--- a/packages/player-example/config/jest/fileTransform.js
+++ /dev/null
@@ -1,40 +0,0 @@
-'use strict';
-
-const path = require('path');
-const camelcase = require('camelcase');
-
-// This is a custom Jest transformer turning file imports into filenames.
-// http://facebook.github.io/jest/docs/en/webpack.html
-
-module.exports = {
- process(src, filename) {
- const assetFilename = JSON.stringify(path.basename(filename));
-
- if (filename.match(/\.svg$/)) {
- // Based on how SVGR generates a component name:
- // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
- const pascalCaseFilename = camelcase(path.parse(filename).name, {
- pascalCase: true,
- });
- const componentName = `Svg${pascalCaseFilename}`;
- return `const React = require('react');
- module.exports = {
- __esModule: true,
- default: ${assetFilename},
- ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
- return {
- $$typeof: Symbol.for('react.element'),
- type: 'svg',
- ref: ref,
- key: null,
- props: Object.assign({}, props, {
- children: ${assetFilename}
- })
- };
- }),
- };`;
- }
-
- return `module.exports = ${assetFilename};`;
- },
-};
diff --git a/packages/player-example/config/webpack.config.js b/packages/player-example/config/webpack.config.js
index 207d075f08..533c959aef 100644
--- a/packages/player-example/config/webpack.config.js
+++ b/packages/player-example/config/webpack.config.js
@@ -5,12 +5,11 @@ const path = require('path');
const webpack = require('webpack');
const resolve = require('resolve');
const HtmlWebpackPlugin = require('html-webpack-plugin');
-const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
const TerserPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
-const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
+const {WebpackManifestPlugin} = require('webpack-manifest-plugin');
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
@@ -21,9 +20,9 @@ const modules = require('./modules');
const getClientEnvironment = require('./env');
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
const ForkTsCheckerWebpackPlugin =
- process.env.TSC_COMPILE_ON_ERROR === 'true'
- ? require('react-dev-utils/ForkTsCheckerWarningWebpackPlugin')
- : require('react-dev-utils/ForkTsCheckerWebpackPlugin');
+ process.env.TSC_COMPILE_ON_ERROR === 'true'
+ ? require('react-dev-utils/ForkTsCheckerWarningWebpackPlugin')
+ : require('react-dev-utils/ForkTsCheckerWebpackPlugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const createEnvironmentHash = require('./webpack/persistentCache/createEnvironmentHash');
@@ -33,15 +32,15 @@ const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
const reactRefreshRuntimeEntry = require.resolve('react-refresh/runtime');
const reactRefreshWebpackPluginRuntimeEntry = require.resolve(
- '@pmmmwh/react-refresh-webpack-plugin'
+ '@pmmmwh/react-refresh-webpack-plugin'
);
const babelRuntimeEntry = require.resolve('babel-preset-react-app');
const babelRuntimeEntryHelpers = require.resolve(
- '@babel/runtime/helpers/esm/assertThisInitialized',
- { paths: [babelRuntimeEntry] }
+ '@babel/runtime/helpers/esm/assertThisInitialized',
+ {paths: [babelRuntimeEntry]}
);
const babelRuntimeRegenerator = require.resolve('@babel/runtime/regenerator', {
- paths: [babelRuntimeEntry],
+ paths: [babelRuntimeEntry],
});
// Some apps do not need the benefits of saving a web request, so not inlining the chunk
@@ -52,7 +51,7 @@ const emitErrorsAsWarnings = process.env.ESLINT_NO_DEV_ERRORS === 'true';
const disableESLintPlugin = process.env.DISABLE_ESLINT_PLUGIN === 'true';
const imageInlineSizeLimit = parseInt(
- process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
+ process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
);
// Check if TypeScript is setup
@@ -60,7 +59,7 @@ const useTypeScript = fs.existsSync(paths.appTsConfig);
// Check if Tailwind config exists
const useTailwind = fs.existsSync(
- path.join(paths.appPath, 'tailwind.config.js')
+ path.join(paths.appPath, 'tailwind.config.js')
);
// Get the path to the uncompiled service worker (if it exists).
@@ -73,683 +72,654 @@ const sassRegex = /\.(scss|sass)$/;
const sassModuleRegex = /\.module\.(scss|sass)$/;
const hasJsxRuntime = (() => {
- if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
- return false;
- }
+ if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
+ return false;
+ }
- try {
- require.resolve('react/jsx-runtime');
- return true;
- } catch (e) {
- return false;
- }
+ try {
+ require.resolve('react/jsx-runtime');
+ return true;
+ } catch (e) {
+ return false;
+ }
})();
// This is the production and development configuration.
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
module.exports = function (webpackEnv) {
- const isEnvDevelopment = webpackEnv === 'development';
- const isEnvProduction = webpackEnv === 'production';
+ const isEnvDevelopment = webpackEnv === 'development';
+ const isEnvProduction = webpackEnv === 'production';
- // Variable used for enabling profiling in Production
- // passed into alias object. Uses a flag if passed into the build command
- const isEnvProductionProfile =
- isEnvProduction && process.argv.includes('--profile');
+ // Variable used for enabling profiling in Production
+ // passed into alias object. Uses a flag if passed into the build command
+ const isEnvProductionProfile =
+ isEnvProduction && process.argv.includes('--profile');
- // We will provide `paths.publicUrlOrPath` to our app
- // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
- // Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
- // Get environment variables to inject into our app.
- const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
+ // We will provide `paths.publicUrlOrPath` to our app
+ // as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
+ // Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
+ // Get environment variables to inject into our app.
+ const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
- const shouldUseReactRefresh = env.raw.FAST_REFRESH;
+ const shouldUseReactRefresh = env.raw.FAST_REFRESH;
- // common function to get style loaders
- const getStyleLoaders = (cssOptions, preProcessor) => {
- const loaders = [
- isEnvDevelopment && require.resolve('style-loader'),
- isEnvProduction && {
- loader: MiniCssExtractPlugin.loader,
- // css is located in `static/css`, use '../../' to locate index.html folder
- // in production `paths.publicUrlOrPath` can be a relative path
- options: paths.publicUrlOrPath.startsWith('.')
- ? { publicPath: '../../' }
- : {},
- },
- {
- loader: require.resolve('css-loader'),
- options: cssOptions,
- },
- {
- // Options for PostCSS as we reference these options twice
- // Adds vendor prefixing based on your specified browser support in
- // package.json
- loader: require.resolve('postcss-loader'),
- options: {
- postcssOptions: {
- // Necessary for external CSS imports to work
- // https://github.com/facebook/create-react-app/issues/2677
- ident: 'postcss',
- config: false,
- plugins: !useTailwind
- ? [
- 'postcss-flexbugs-fixes',
- [
- 'postcss-preset-env',
- {
- autoprefixer: {
- flexbox: 'no-2009',
- },
- stage: 3,
- },
- ],
- // Adds PostCSS Normalize as the reset css with default options,
- // so that it honors browserslist config in package.json
- // which in turn let's users customize the target behavior as per their needs.
- 'postcss-normalize',
- ]
- : [
- 'tailwindcss',
- 'postcss-flexbugs-fixes',
- [
- 'postcss-preset-env',
- {
- autoprefixer: {
- flexbox: 'no-2009',
- },
- stage: 3,
- },
- ],
- ],
- },
- sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
- },
- },
- ].filter(Boolean);
- if (preProcessor) {
- loaders.push(
- {
- loader: require.resolve('resolve-url-loader'),
- options: {
- sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
- root: paths.appSrc,
- },
- },
- {
- loader: require.resolve(preProcessor),
- options: {
- sourceMap: true,
- },
- }
- );
- }
- return loaders;
- };
+ // common function to get style loaders
+ const getStyleLoaders = (cssOptions, preProcessor) => {
+ const loaders = [
+ isEnvDevelopment && require.resolve('style-loader'),
+ isEnvProduction && {
+ loader: MiniCssExtractPlugin.loader,
+ // css is located in `static/css`, use '../../' to locate index.html folder
+ // in production `paths.publicUrlOrPath` can be a relative path
+ options: paths.publicUrlOrPath.startsWith('.')
+ ? {publicPath: '../../'}
+ : {},
+ },
+ {
+ loader: require.resolve('css-loader'),
+ options: cssOptions,
+ },
+ {
+ // Options for PostCSS as we reference these options twice
+ // Adds vendor prefixing based on your specified browser support in
+ // package.json
+ loader: require.resolve('postcss-loader'),
+ options: {
+ postcssOptions: {
+ // Necessary for external CSS imports to work
+ // https://github.com/facebook/create-react-app/issues/2677
+ ident: 'postcss',
+ config: false,
+ plugins: !useTailwind
+ ? [
+ 'postcss-flexbugs-fixes',
+ [
+ 'postcss-preset-env',
+ {
+ autoprefixer: {
+ flexbox: 'no-2009',
+ },
+ stage: 3,
+ },
+ ],
+ // Adds PostCSS Normalize as the reset css with default options,
+ // so that it honors browserslist config in package.json
+ // which in turn let's users customize the target behavior as per their needs.
+ 'postcss-normalize',
+ ]
+ : [
+ 'tailwindcss',
+ 'postcss-flexbugs-fixes',
+ [
+ 'postcss-preset-env',
+ {
+ autoprefixer: {
+ flexbox: 'no-2009',
+ },
+ stage: 3,
+ },
+ ],
+ ],
+ },
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
+ },
+ },
+ ].filter(Boolean);
+ if (preProcessor) {
+ loaders.push(
+ {
+ loader: require.resolve('resolve-url-loader'),
+ options: {
+ sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
+ root: paths.appSrc,
+ },
+ },
+ {
+ loader: require.resolve(preProcessor),
+ options: {
+ sourceMap: true,
+ },
+ }
+ );
+ }
+ return loaders;
+ };
- return {
- target: ['browserslist'],
- // Webpack noise constrained to errors and warnings
- stats: 'errors-warnings',
- mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
- // Stop compilation early in production
- bail: isEnvProduction,
- devtool: isEnvProduction
- ? shouldUseSourceMap
- ? 'source-map'
- : false
- : isEnvDevelopment && 'cheap-module-source-map',
- // These are the "entry points" to our application.
- // This means they will be the "root" imports that are included in JS bundle.
- entry: paths.appIndexJs,
- output: {
- // The build folder.
- path: paths.appBuild,
- // Add /* filename */ comments to generated require()s in the output.
- pathinfo: isEnvDevelopment,
- // There will be one main bundle, and one file per asynchronous chunk.
- // In development, it does not produce real files.
- filename: isEnvProduction
- ? 'static/js/[name].[contenthash:8].js'
- : isEnvDevelopment && 'static/js/bundle.js',
- // There are also additional JS chunk files if you use code splitting.
- chunkFilename: isEnvProduction
- ? 'static/js/[name].[contenthash:8].chunk.js'
- : isEnvDevelopment && 'static/js/[name].chunk.js',
- assetModuleFilename: 'static/media/[name].[hash][ext]',
- // webpack uses `publicPath` to determine where the app is being served from.
- // It requires a trailing slash, or the file assets will get an incorrect path.
- // We inferred the "public path" (such as / or /my-project) from homepage.
- publicPath: paths.publicUrlOrPath,
- // Point sourcemap entries to original disk location (format as URL on Windows)
- devtoolModuleFilenameTemplate: isEnvProduction
- ? info =>
- path
- .relative(paths.appSrc, info.absoluteResourcePath)
- .replace(/\\/g, '/')
- : isEnvDevelopment &&
- (info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
- },
- cache: {
- type: 'filesystem',
- version: createEnvironmentHash(env.raw),
- cacheDirectory: paths.appWebpackCache,
- store: 'pack',
- buildDependencies: {
- defaultWebpack: ['webpack/lib/'],
- config: [__filename],
- tsconfig: [paths.appTsConfig, paths.appJsConfig].filter(f =>
- fs.existsSync(f)
- ),
- },
- },
- infrastructureLogging: {
- level: 'none',
- },
- optimization: {
- minimize: isEnvProduction,
- minimizer: [
- // This is only used in production mode
- new TerserPlugin({
- terserOptions: {
- parse: {
- // We want terser to parse ecma 8 code. However, we don't want it
- // to apply any minification steps that turns valid ecma 5 code
- // into invalid ecma 5 code. This is why the 'compress' and 'output'
- // sections only apply transformations that are ecma 5 safe
- // https://github.com/facebook/create-react-app/pull/4234
- ecma: 8,
- },
- compress: {
- ecma: 5,
- warnings: false,
- // Disabled because of an issue with Uglify breaking seemingly valid code:
- // https://github.com/facebook/create-react-app/issues/2376
- // Pending further investigation:
- // https://github.com/mishoo/UglifyJS2/issues/2011
- comparisons: false,
- // Disabled because of an issue with Terser breaking valid code:
- // https://github.com/facebook/create-react-app/issues/5250
- // Pending further investigation:
- // https://github.com/terser-js/terser/issues/120
- inline: 2,
- },
- mangle: {
- safari10: true,
- },
- // Added for profiling in devtools
- keep_classnames: isEnvProductionProfile,
- keep_fnames: isEnvProductionProfile,
- output: {
- ecma: 5,
- comments: false,
- // Turned on because emoji and regex is not minified properly using default
- // https://github.com/facebook/create-react-app/issues/2488
- ascii_only: true,
- },
- },
- }),
- // This is only used in production mode
- new CssMinimizerPlugin(),
- ],
- },
- resolve: {
- // This allows you to set a fallback for where webpack should look for modules.
- // We placed these paths second because we want `node_modules` to "win"
- // if there are any conflicts. This matches Node resolution mechanism.
- // https://github.com/facebook/create-react-app/issues/253
- modules: ['node_modules', paths.appNodeModules].concat(
- modules.additionalModulePaths || []
- ),
- // These are the reasonable defaults supported by the Node ecosystem.
- // We also include JSX as a common component filename extension to support
- // some tools, although we do not recommend using it, see:
- // https://github.com/facebook/create-react-app/issues/290
- // `web` extension prefixes have been added for better support
- // for React Native Web.
- extensions: paths.moduleFileExtensions
- .map(ext => `.${ext}`)
- .filter(ext => useTypeScript || !ext.includes('ts')),
- alias: {
- // Support React Native Web
- // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
- 'react-native': 'react-native-web',
- // Allows for better profiling with ReactDevTools
- ...(isEnvProductionProfile && {
- 'react-dom$': 'react-dom/profiling',
- 'scheduler/tracing': 'scheduler/tracing-profiling',
- }),
- ...(modules.webpackAliases || {}),
- },
- plugins: [
- // Prevents users from importing files from outside of src/ (or node_modules/).
- // This often causes confusion because we only process files within src/ with babel.
- // To fix this, we prevent you from importing files out of src/ -- if you'd like to,
- // please link the files into your node_modules/ and let module-resolution kick in.
- // Make sure your source files are compiled, as they will not be processed in any way.
- new ModuleScopePlugin(paths.appSrc, [
- paths.appPackageJson,
- reactRefreshRuntimeEntry,
- reactRefreshWebpackPluginRuntimeEntry,
- babelRuntimeEntry,
- babelRuntimeEntryHelpers,
- babelRuntimeRegenerator,
- ]),
- ],
- },
- module: {
- strictExportPresence: true,
- rules: [
- // Handle node_modules packages that contain sourcemaps
- shouldUseSourceMap && {
- enforce: 'pre',
- exclude: /@babel(?:\/|\\{1,2})runtime/,
- test: /\.(js|mjs|jsx|ts|tsx|css)$/,
- loader: require.resolve('source-map-loader'),
- },
- {
- // "oneOf" will traverse all following loaders until one will
- // match the requirements. When no loader matches it will fall
- // back to the "file" loader at the end of the loader list.
- oneOf: [
- // TODO: Merge this config once `image/avif` is in the mime-db
- // https://github.com/jshttp/mime-db
- {
- test: [/\.avif$/],
- type: 'asset',
- mimetype: 'image/avif',
- parser: {
- dataUrlCondition: {
- maxSize: imageInlineSizeLimit,
- },
- },
- },
- // "url" loader works like "file" loader except that it embeds assets
- // smaller than specified limit in bytes as data URLs to avoid requests.
- // A missing `test` is equivalent to a match.
- {
- test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
- type: 'asset',
- parser: {
- dataUrlCondition: {
- maxSize: imageInlineSizeLimit,
- },
- },
- },
- {
- test: /\.svg$/,
- use: [
- {
- loader: require.resolve('@svgr/webpack'),
- options: {
- prettier: false,
- svgo: false,
- svgoConfig: {
- plugins: [{ removeViewBox: false }],
- },
- titleProp: true,
- ref: true,
- },
- },
- {
- loader: require.resolve('file-loader'),
- options: {
- name: 'static/media/[name].[hash].[ext]',
- },
- },
- ],
- issuer: {
- and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
- },
- },
- // Process application JS with Babel.
- // The preset includes JSX, Flow, TypeScript, and some ESnext features.
- {
- test: /\.(js|mjs|jsx|ts|tsx)$/,
- include: paths.appSrc,
- loader: require.resolve('babel-loader'),
- options: {
- customize: require.resolve(
- 'babel-preset-react-app/webpack-overrides'
- ),
- presets: [
- [
- require.resolve('babel-preset-react-app'),
- {
- runtime: hasJsxRuntime ? 'automatic' : 'classic',
- },
- ],
- ],
-
- plugins: [
- isEnvDevelopment &&
- shouldUseReactRefresh &&
- require.resolve('react-refresh/babel'),
- ].filter(Boolean),
- // This is a feature of `babel-loader` for webpack (not Babel itself).
- // It enables caching results in ./node_modules/.cache/babel-loader/
- // directory for faster rebuilds.
- cacheDirectory: true,
- // See #6846 for context on why cacheCompression is disabled
- cacheCompression: false,
- compact: isEnvProduction,
- },
- },
- // Process any JS outside of the app with Babel.
- // Unlike the application JS, we only compile the standard ES features.
- {
- test: /\.(js|mjs)$/,
- exclude: /@babel(?:\/|\\{1,2})runtime/,
- loader: require.resolve('babel-loader'),
- options: {
- babelrc: false,
- configFile: false,
- compact: false,
- presets: [
- [
- require.resolve('babel-preset-react-app/dependencies'),
- { helpers: true },
- ],
- ],
- cacheDirectory: true,
- // See #6846 for context on why cacheCompression is disabled
- cacheCompression: false,
-
- // Babel sourcemaps are needed for debugging into node_modules
- // code. Without the options below, debuggers like VSCode
- // show incorrect code and set breakpoints on the wrong lines.
- sourceMaps: shouldUseSourceMap,
- inputSourceMap: shouldUseSourceMap,
- },
- },
- // "postcss" loader applies autoprefixer to our CSS.
- // "css" loader resolves paths in CSS and adds assets as dependencies.
- // "style" loader turns CSS into JS modules that inject <style> tags.
- // In production, we use MiniCSSExtractPlugin to extract that CSS
- // to a file, but in development "style" loader enables hot editing
- // of CSS.
- // By default we support CSS Modules with the extension .module.css
- {
- test: cssRegex,
- exclude: cssModuleRegex,
- use: getStyleLoaders({
- importLoaders: 1,
- sourceMap: isEnvProduction
- ? shouldUseSourceMap
- : isEnvDevelopment,
- modules: {
- mode: 'icss',
- },
- }),
- // Don't consider CSS imports dead code even if the
- // containing package claims to have no side effects.
- // Remove this when webpack adds a warning or an error for this.
- // See https://github.com/webpack/webpack/issues/6571
- sideEffects: true,
- },
- // Adds support for CSS Modules (https://github.com/css-modules/css-modules)
- // using the extension .module.css
- {
- test: cssModuleRegex,
- use: getStyleLoaders({
- importLoaders: 1,
- sourceMap: isEnvProduction
- ? shouldUseSourceMap
- : isEnvDevelopment,
- modules: {
- mode: 'local',
- getLocalIdent: getCSSModuleLocalIdent,
- },
- }),
- },
- // Opt-in support for SASS (using .scss or .sass extensions).
- // By default we support SASS Modules with the
- // extensions .module.scss or .module.sass
- {
- test: sassRegex,
- exclude: sassModuleRegex,
- use: getStyleLoaders(
- {
- importLoaders: 3,
- sourceMap: isEnvProduction
- ? shouldUseSourceMap
- : isEnvDevelopment,
- modules: {
- mode: 'icss',
- },
- },
- 'sass-loader'
- ),
- // Don't consider CSS imports dead code even if the
- // containing package claims to have no side effects.
- // Remove this when webpack adds a warning or an error for this.
- // See https://github.com/webpack/webpack/issues/6571
- sideEffects: true,
- },
- // Adds support for CSS Modules, but using SASS
- // using the extension .module.scss or .module.sass
- {
- test: sassModuleRegex,
- use: getStyleLoaders(
- {
- importLoaders: 3,
- sourceMap: isEnvProduction
- ? shouldUseSourceMap
- : isEnvDevelopment,
- modules: {
- mode: 'local',
- getLocalIdent: getCSSModuleLocalIdent,
- },
- },
- 'sass-loader'
- ),
- },
- // "file" loader makes sure those assets get served by WebpackDevServer.
- // When you `import` an asset, you get its (virtual) filename.
- // In production, they would get copied to the `build` folder.
- // This loader doesn't use a "test" so it will catch all modules
- // that fall through the other loaders.
- {
- // Exclude `js` files to keep "css" loader working as it injects
- // its runtime that would otherwise be processed through "file" loader.
- // Also exclude `html` and `json` extensions so they get processed
- // by webpacks internal loaders.
- exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
- type: 'asset/resource',
- },
- // ** STOP ** Are you adding a new loader?
- // Make sure to add the new loader(s) before the "file" loader.
- ],
- },
- ].filter(Boolean),
- },
- plugins: [
- // Generates an `index.html` file with the <script> injected.
- new HtmlWebpackPlugin(
- Object.assign(
- {},
- {
- inject: true,
- template: paths.appHtml,
- },
- isEnvProduction
- ? {
- minify: {
- removeComments: true,
- collapseWhitespace: true,
- removeRedundantAttributes: true,
- useShortDoctype: true,
- removeEmptyAttributes: true,
- removeStyleLinkTypeAttributes: true,
- keepClosingSlash: true,
- minifyJS: true,
- minifyCSS: true,
- minifyURLs: true,
- },
- }
- : undefined
- )
- ),
- // Inlines the webpack runtime script. This script is too small to warrant
- // a network request.
- // https://github.com/facebook/create-react-app/issues/5358
- isEnvProduction &&
- shouldInlineRuntimeChunk &&
- new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/]),
- // Makes some environment variables available in index.html.
- // The public URL is available as %PUBLIC_URL% in index.html, e.g.:
- // <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
- // It will be an empty string unless you specify "homepage"
- // in `package.json`, in which case it will be the pathname of that URL.
- new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
- // This gives some necessary context to module not found errors, such as
- // the requesting resource.
- new ModuleNotFoundPlugin(paths.appPath),
- // Makes some environment variables available to the JS code, for example:
- // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
- // It is absolutely essential that NODE_ENV is set to production
- // during a production build.
- // Otherwise React will be compiled in the very slow development mode.
- new webpack.DefinePlugin(env.stringified),
- // Experimental hot reloading for React .
- // https://github.com/facebook/react/tree/main/packages/react-refresh
- isEnvDevelopment &&
- shouldUseReactRefresh &&
- new ReactRefreshWebpackPlugin({
- overlay: false,
- }),
- // Watcher doesn't work well if you mistype casing in a path so we use
- // a plugin that prints an error when you attempt to do this.
- // See https://github.com/facebook/create-react-app/issues/240
- isEnvDevelopment && new CaseSensitivePathsPlugin(),
- isEnvProduction &&
- new MiniCssExtractPlugin({
- // Options similar to the same options in webpackOptions.output
- // both options are optional
- filename: 'static/css/[name].[contenthash:8].css',
- chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
- }),
- // Generate an asset manifest file with the following content:
- // - "files" key: Mapping of all asset filenames to their corresponding
- // output file so that tools can pick it up without having to parse
- // `index.html`
- // - "entrypoints" key: Array of files which are included in `index.html`,
- // can be used to reconstruct the HTML if necessary
- new WebpackManifestPlugin({
- fileName: 'asset-manifest.json',
- publicPath: paths.publicUrlOrPath,
- generate: (seed, files, entrypoints) => {
- const manifestFiles = files.reduce((manifest, file) => {
- manifest[file.name] = file.path;
- return manifest;
- }, seed);
- const entrypointFiles = entrypoints.main.filter(
- fileName => !fileName.endsWith('.map')
- );
+ return {
+ target: ['browserslist'],
+ // Webpack noise constrained to errors and warnings
+ stats: 'errors-warnings',
+ mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
+ // Stop compilation early in production
+ bail: isEnvProduction,
+ devtool: isEnvProduction
+ ? shouldUseSourceMap
+ ? 'source-map'
+ : false
+ : isEnvDevelopment && 'cheap-module-source-map',
+ // These are the "entry points" to our application.
+ // This means they will be the "root" imports that are included in JS bundle.
+ entry: paths.appIndexJs,
+ output: {
+ // The build folder.
+ path: paths.appBuild,
+ // Add /* filename */ comments to generated require()s in the output.
+ pathinfo: isEnvDevelopment,
+ // There will be one main bundle, and one file per asynchronous chunk.
+ // In development, it does not produce real files.
+ filename: isEnvProduction
+ ? 'static/js/[name].[contenthash:8].js'
+ : isEnvDevelopment && 'static/js/bundle.js',
+ // There are also additional JS chunk files if you use code splitting.
+ chunkFilename: isEnvProduction
+ ? 'static/js/[name].[contenthash:8].chunk.js'
+ : isEnvDevelopment && 'static/js/[name].chunk.js',
+ assetModuleFilename: 'static/media/[name].[hash][ext]',
+ // webpack uses `publicPath` to determine where the app is being served from.
+ // It requires a trailing slash, or the file assets will get an incorrect path.
+ // We inferred the "public path" (such as / or /my-project) from homepage.
+ publicPath: paths.publicUrlOrPath,
+ // Point sourcemap entries to original disk location (format as URL on Windows)
+ devtoolModuleFilenameTemplate: isEnvProduction
+ ? (info) =>
+ path
+ .relative(paths.appSrc, info.absoluteResourcePath)
+ .replace(/\\/g, '/')
+ : isEnvDevelopment &&
+ ((info) =>
+ path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
+ },
+ cache: {
+ type: 'filesystem',
+ version: createEnvironmentHash(env.raw),
+ cacheDirectory: paths.appWebpackCache,
+ store: 'pack',
+ buildDependencies: {
+ defaultWebpack: ['webpack/lib/'],
+ config: [__filename],
+ tsconfig: [paths.appTsConfig, paths.appJsConfig].filter((f) =>
+ fs.existsSync(f)
+ ),
+ },
+ },
+ infrastructureLogging: {
+ level: 'none',
+ },
+ optimization: {
+ minimize: isEnvProduction,
+ minimizer: [
+ // This is only used in production mode
+ new TerserPlugin({
+ terserOptions: {
+ parse: {
+ // We want terser to parse ecma 8 code. However, we don't want it
+ // to apply any minification steps that turns valid ecma 5 code
+ // into invalid ecma 5 code. This is why the 'compress' and 'output'
+ // sections only apply transformations that are ecma 5 safe
+ // https://github.com/facebook/create-react-app/pull/4234
+ ecma: 8,
+ },
+ compress: {
+ ecma: 5,
+ warnings: false,
+ // Disabled because of an issue with Uglify breaking seemingly valid code:
+ // https://github.com/facebook/create-react-app/issues/2376
+ // Pending further investigation:
+ // https://github.com/mishoo/UglifyJS2/issues/2011
+ comparisons: false,
+ // Disabled because of an issue with Terser breaking valid code:
+ // https://github.com/facebook/create-react-app/issues/5250
+ // Pending further investigation:
+ // https://github.com/terser-js/terser/issues/120
+ inline: 2,
+ },
+ mangle: {
+ safari10: true,
+ },
+ // Added for profiling in devtools
+ keep_classnames: isEnvProductionProfile,
+ keep_fnames: isEnvProductionProfile,
+ output: {
+ ecma: 5,
+ comments: false,
+ // Turned on because emoji and regex is not minified properly using default
+ // https://github.com/facebook/create-react-app/issues/2488
+ ascii_only: true,
+ },
+ },
+ }),
+ // This is only used in production mode
+ new CssMinimizerPlugin(),
+ ],
+ },
+ resolve: {
+ // This allows you to set a fallback for where webpack should look for modules.
+ // We placed these paths second because we want `node_modules` to "win"
+ // if there are any conflicts. This matches Node resolution mechanism.
+ // https://github.com/facebook/create-react-app/issues/253
+ modules: ['node_modules', paths.appNodeModules].concat(
+ modules.additionalModulePaths || []
+ ),
+ // These are the reasonable defaults supported by the Node ecosystem.
+ // We also include JSX as a common component filename extension to support
+ // some tools, although we do not recommend using it, see:
+ // https://github.com/facebook/create-react-app/issues/290
+ // `web` extension prefixes have been added for better support
+ // for React Native Web.
+ extensions: paths.moduleFileExtensions
+ .map((ext) => `.${ext}`)
+ .filter((ext) => useTypeScript || !ext.includes('ts')),
+ alias: {
+ // Support React Native Web
+ // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
+ 'react-native': 'react-native-web',
+ // Allows for better profiling with ReactDevTools
+ ...(isEnvProductionProfile && {
+ 'react-dom$': 'react-dom/profiling',
+ 'scheduler/tracing': 'scheduler/tracing-profiling',
+ }),
+ ...(modules.webpackAliases || {}),
+ },
+ plugins: [
+ // Prevents users from importing files from outside of src/ (or node_modules/).
+ // This often causes confusion because we only process files within src/ with babel.
+ // To fix this, we prevent you from importing files out of src/ -- if you'd like to,
+ // please link the files into your node_modules/ and let module-resolution kick in.
+ // Make sure your source files are compiled, as they will not be processed in any way.
+ new ModuleScopePlugin(paths.appSrc, [
+ paths.appPackageJson,
+ reactRefreshRuntimeEntry,
+ reactRefreshWebpackPluginRuntimeEntry,
+ babelRuntimeEntry,
+ babelRuntimeEntryHelpers,
+ babelRuntimeRegenerator,
+ ]),
+ ],
+ },
+ module: {
+ strictExportPresence: true,
+ rules: [
+ // Handle node_modules packages that contain sourcemaps
+ shouldUseSourceMap && {
+ enforce: 'pre',
+ exclude: /@babel(?:\/|\\{1,2})runtime/,
+ test: /\.(js|mjs|jsx|ts|tsx|css)$/,
+ loader: require.resolve('source-map-loader'),
+ },
+ {
+ // "oneOf" will traverse all following loaders until one will
+ // match the requirements. When no loader matches it will fall
+ // back to the "file" loader at the end of the loader list.
+ oneOf: [
+ // TODO: Merge this config once `image/avif` is in the mime-db
+ // https://github.com/jshttp/mime-db
+ {
+ test: [/\.avif$/],
+ type: 'asset',
+ mimetype: 'image/avif',
+ parser: {
+ dataUrlCondition: {
+ maxSize: imageInlineSizeLimit,
+ },
+ },
+ },
+ // "url" loader works like "file" loader except that it embeds assets
+ // smaller than specified limit in bytes as data URLs to avoid requests.
+ // A missing `test` is equivalent to a match.
+ {
+ test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
+ type: 'asset',
+ parser: {
+ dataUrlCondition: {
+ maxSize: imageInlineSizeLimit,
+ },
+ },
+ },
+ // Process application JS with Babel.
+ // The preset includes JSX, Flow, TypeScript, and some ESnext features.
+ {
+ test: /\.(js|mjs|jsx|ts|tsx)$/,
+ include: paths.appSrc,
+ loader: require.resolve('babel-loader'),
+ options: {
+ customize: require.resolve(
+ 'babel-preset-react-app/webpack-overrides'
+ ),
+ presets: [
+ [
+ require.resolve('babel-preset-react-app'),
+ {
+ runtime: hasJsxRuntime ? 'automatic' : 'classic',
+ },
+ ],
+ ],
- return {
- files: manifestFiles,
- entrypoints: entrypointFiles,
- };
- },
- }),
- // Moment.js is an extremely popular library that bundles large locale files
- // by default due to how webpack interprets its code. This is a practical
- // solution that requires the user to opt into importing specific locales.
- // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
- // You can remove this if you don't use Moment.js:
- new webpack.IgnorePlugin({
- resourceRegExp: /^\.\/locale$/,
- contextRegExp: /moment$/,
- }),
- // Generate a service worker script that will precache, and keep up to date,
- // the HTML & assets that are part of the webpack build.
- isEnvProduction &&
- fs.existsSync(swSrc) &&
- new WorkboxWebpackPlugin.InjectManifest({
- swSrc,
- dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
- exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/],
- // Bump up the default maximum size (2mb) that's precached,
- // to make lazy-loading failure scenarios less likely.
- // See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270
- maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
- }),
- // TypeScript type checking
- useTypeScript &&
- new ForkTsCheckerWebpackPlugin({
- async: isEnvDevelopment,
- typescript: {
- typescriptPath: resolve.sync('typescript', {
- basedir: paths.appNodeModules,
- }),
- configOverwrite: {
- compilerOptions: {
- sourceMap: isEnvProduction
- ? shouldUseSourceMap
- : isEnvDevelopment,
- skipLibCheck: true,
- inlineSourceMap: false,
- declarationMap: false,
- noEmit: true,
- incremental: true,
- tsBuildInfoFile: paths.appTsBuildInfoFile,
- },
- },
- context: paths.appPath,
- diagnosticOptions: {
- syntactic: true,
- },
- mode: 'write-references',
- // profile: true,
- },
- issue: {
- // This one is specifically to match during CI tests,
- // as micromatch doesn't match
- // '../cra-template-typescript/template/src/App.tsx'
- // otherwise.
- include: [
- { file: '../**/src/**/*.{ts,tsx}' },
- { file: '**/src/**/*.{ts,tsx}' },
- ],
- exclude: [
- { file: '**/src/**/__tests__/**' },
- { file: '**/src/**/?(*.){spec|test}.*' },
- { file: '**/src/setupProxy.*' },
- { file: '**/src/setupTests.*' },
- ],
- },
- logger: {
- infrastructure: 'silent',
- },
- }),
- !disableESLintPlugin &&
- new ESLintPlugin({
- // Plugin options
- extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
- formatter: require.resolve('react-dev-utils/eslintFormatter'),
- eslintPath: require.resolve('eslint'),
- failOnError: !(isEnvDevelopment && emitErrorsAsWarnings),
- context: paths.appSrc,
- cache: true,
- cacheLocation: path.resolve(
- paths.appNodeModules,
- '.cache/.eslintcache'
- ),
- // ESLint class options
- cwd: paths.appPath,
- resolvePluginsRelativeTo: __dirname,
- baseConfig: {
- extends: [require.resolve('eslint-config-react-app/base')],
- rules: {
- ...(!hasJsxRuntime && {
- 'react/react-in-jsx-scope': 'error',
- }),
- },
- },
- }),
- ].filter(Boolean),
- // Turn off performance processing because we utilize
- // our own hints via the FileSizeReporter
- performance: false,
- };
+ plugins: [
+ isEnvDevelopment &&
+ shouldUseReactRefresh &&
+ require.resolve('react-refresh/babel'),
+ ].filter(Boolean),
+ // This is a feature of `babel-loader` for webpack (not Babel itself).
+ // It enables caching results in ./node_modules/.cache/babel-loader/
+ // directory for faster rebuilds.
+ cacheDirectory: true,
+ // See #6846 for context on why cacheCompression is disabled
+ cacheCompression: false,
+ compact: isEnvProduction,
+ },
+ },
+ // Process any JS outside of the app with Babel.
+ // Unlike the application JS, we only compile the standard ES features.
+ {
+ test: /\.(js|mjs)$/,
+ exclude: /@babel(?:\/|\\{1,2})runtime/,
+ loader: require.resolve('babel-loader'),
+ options: {
+ babelrc: false,
+ configFile: false,
+ compact: false,
+ presets: [
+ [
+ require.resolve('babel-preset-react-app/dependencies'),
+ {helpers: true},
+ ],
+ ],
+ cacheDirectory: true,
+ // See #6846 for context on why cacheCompression is disabled
+ cacheCompression: false,
+
+ // Babel sourcemaps are needed for debugging into node_modules
+ // code. Without the options below, debuggers like VSCode
+ // show incorrect code and set breakpoints on the wrong lines.
+ sourceMaps: shouldUseSourceMap,
+ inputSourceMap: shouldUseSourceMap,
+ },
+ },
+ // "postcss" loader applies autoprefixer to our CSS.
+ // "css" loader resolves paths in CSS and adds assets as dependencies.
+ // "style" loader turns CSS into JS modules that inject <style> tags.
+ // In production, we use MiniCSSExtractPlugin to extract that CSS
+ // to a file, but in development "style" loader enables hot editing
+ // of CSS.
+ // By default we support CSS Modules with the extension .module.css
+ {
+ test: cssRegex,
+ exclude: cssModuleRegex,
+ use: getStyleLoaders({
+ importLoaders: 1,
+ sourceMap: isEnvProduction
+ ? shouldUseSourceMap
+ : isEnvDevelopment,
+ modules: {
+ mode: 'icss',
+ },
+ }),
+ // Don't consider CSS imports dead code even if the
+ // containing package claims to have no side effects.
+ // Remove this when webpack adds a warning or an error for this.
+ // See https://github.com/webpack/webpack/issues/6571
+ sideEffects: true,
+ },
+ // Adds support for CSS Modules (https://github.com/css-modules/css-modules)
+ // using the extension .module.css
+ {
+ test: cssModuleRegex,
+ use: getStyleLoaders({
+ importLoaders: 1,
+ sourceMap: isEnvProduction
+ ? shouldUseSourceMap
+ : isEnvDevelopment,
+ modules: {
+ mode: 'local',
+ getLocalIdent: getCSSModuleLocalIdent,
+ },
+ }),
+ },
+ // Opt-in support for SASS (using .scss or .sass extensions).
+ // By default we support SASS Modules with the
+ // extensions .module.scss or .module.sass
+ {
+ test: sassRegex,
+ exclude: sassModuleRegex,
+ use: getStyleLoaders(
+ {
+ importLoaders: 3,
+ sourceMap: isEnvProduction
+ ? shouldUseSourceMap
+ : isEnvDevelopment,
+ modules: {
+ mode: 'icss',
+ },
+ },
+ 'sass-loader'
+ ),
+ // Don't consider CSS imports dead code even if the
+ // containing package claims to have no side effects.
+ // Remove this when webpack adds a warning or an error for this.
+ // See https://github.com/webpack/webpack/issues/6571
+ sideEffects: true,
+ },
+ // Adds support for CSS Modules, but using SASS
+ // using the extension .module.scss or .module.sass
+ {
+ test: sassModuleRegex,
+ use: getStyleLoaders(
+ {
+ importLoaders: 3,
+ sourceMap: isEnvProduction
+ ? shouldUseSourceMap
+ : isEnvDevelopment,
+ modules: {
+ mode: 'local',
+ getLocalIdent: getCSSModuleLocalIdent,
+ },
+ },
+ 'sass-loader'
+ ),
+ },
+ // "file" loader makes sure those assets get served by WebpackDevServer.
+ // When you `import` an asset, you get its (virtual) filename.
+ // In production, they would get copied to the `build` folder.
+ // This loader doesn't use a "test" so it will catch all modules
+ // that fall through the other loaders.
+ {
+ // Exclude `js` files to keep "css" loader working as it injects
+ // its runtime that would otherwise be processed through "file" loader.
+ // Also exclude `html` and `json` extensions so they get processed
+ // by webpacks internal loaders.
+ exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
+ type: 'asset/resource',
+ },
+ // ** STOP ** Are you adding a new loader?
+ // Make sure to add the new loader(s) before the "file" loader.
+ ],
+ },
+ ].filter(Boolean),
+ },
+ plugins: [
+ // Generates an `index.html` file with the <script> injected.
+ new HtmlWebpackPlugin(
+ Object.assign(
+ {},
+ {
+ inject: true,
+ template: paths.appHtml,
+ },
+ isEnvProduction
+ ? {
+ minify: {
+ removeComments: true,
+ collapseWhitespace: true,
+ removeRedundantAttributes: true,
+ useShortDoctype: true,
+ removeEmptyAttributes: true,
+ removeStyleLinkTypeAttributes: true,
+ keepClosingSlash: true,
+ minifyJS: true,
+ minifyCSS: true,
+ minifyURLs: true,
+ },
+ }
+ : undefined
+ )
+ ),
+ // Inlines the webpack runtime script. This script is too small to warrant
+ // a network request.
+ // https://github.com/facebook/create-react-app/issues/5358
+ isEnvProduction &&
+ shouldInlineRuntimeChunk &&
+ new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/]),
+ // Makes some environment variables available in index.html.
+ // The public URL is available as %PUBLIC_URL% in index.html, e.g.:
+ // <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
+ // It will be an empty string unless you specify "homepage"
+ // in `package.json`, in which case it will be the pathname of that URL.
+ new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
+ // This gives some necessary context to module not found errors, such as
+ // the requesting resource.
+ new ModuleNotFoundPlugin(paths.appPath),
+ // Makes some environment variables available to the JS code, for example:
+ // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
+ // It is absolutely essential that NODE_ENV is set to production
+ // during a production build.
+ // Otherwise React will be compiled in the very slow development mode.
+ new webpack.DefinePlugin(env.stringified),
+ // Experimental hot reloading for React .
+ // https://github.com/facebook/react/tree/main/packages/react-refresh
+ isEnvDevelopment &&
+ shouldUseReactRefresh &&
+ new ReactRefreshWebpackPlugin({
+ overlay: false,
+ }),
+ isEnvProduction &&
+ new MiniCssExtractPlugin({
+ // Options similar to the same options in webpackOptions.output
+ // both options are optional
+ filename: 'static/css/[name].[contenthash:8].css',
+ chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
+ }),
+ // Generate an asset manifest file with the following content:
+ // - "files" key: Mapping of all asset filenames to their corresponding
+ // output file so that tools can pick it up without having to parse
+ // `index.html`
+ // - "entrypoints" key: Array of files which are included in `index.html`,
+ // can be used to reconstruct the HTML if necessary
+ new WebpackManifestPlugin({
+ fileName: 'asset-manifest.json',
+ publicPath: paths.publicUrlOrPath,
+ generate: (seed, files, entrypoints) => {
+ const manifestFiles = files.reduce((manifest, file) => {
+ manifest[file.name] = file.path;
+ return manifest;
+ }, seed);
+ const entrypointFiles = entrypoints.main.filter(
+ (fileName) => !fileName.endsWith('.map')
+ );
+
+ return {
+ files: manifestFiles,
+ entrypoints: entrypointFiles,
+ };
+ },
+ }),
+ // Moment.js is an extremely popular library that bundles large locale files
+ // by default due to how webpack interprets its code. This is a practical
+ // solution that requires the user to opt into importing specific locales.
+ // https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
+ // You can remove this if you don't use Moment.js:
+ new webpack.IgnorePlugin({
+ resourceRegExp: /^\.\/locale$/,
+ contextRegExp: /moment$/,
+ }),
+ // Generate a service worker script that will precache, and keep up to date,
+ // the HTML & assets that are part of the webpack build.
+ isEnvProduction &&
+ fs.existsSync(swSrc) &&
+ new WorkboxWebpackPlugin.InjectManifest({
+ swSrc,
+ dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
+ exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/],
+ // Bump up the default maximum size (2mb) that's precached,
+ // to make lazy-loading failure scenarios less likely.
+ // See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270
+ maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
+ }),
+ // TypeScript type checking
+ useTypeScript &&
+ new ForkTsCheckerWebpackPlugin({
+ async: isEnvDevelopment,
+ typescript: {
+ typescriptPath: resolve.sync('typescript', {
+ basedir: paths.appNodeModules,
+ }),
+ configOverwrite: {
+ compilerOptions: {
+ sourceMap: isEnvProduction
+ ? shouldUseSourceMap
+ : isEnvDevelopment,
+ skipLibCheck: true,
+ inlineSourceMap: false,
+ declarationMap: false,
+ noEmit: true,
+ incremental: true,
+ tsBuildInfoFile: paths.appTsBuildInfoFile,
+ },
+ },
+ context: paths.appPath,
+ diagnosticOptions: {
+ syntactic: true,
+ },
+ mode: 'write-references',
+ // profile: true,
+ },
+ issue: {
+ // This one is specifically to match during CI tests,
+ // as micromatch doesn't match
+ // '../cra-template-typescript/template/src/App.tsx'
+ // otherwise.
+ include: [
+ {file: '../**/src/**/*.{ts,tsx}'},
+ {file: '**/src/**/*.{ts,tsx}'},
+ ],
+ exclude: [
+ {file: '**/src/**/__tests__/**'},
+ {file: '**/src/**/?(*.){spec|test}.*'},
+ {file: '**/src/setupProxy.*'},
+ {file: '**/src/setupTests.*'},
+ ],
+ },
+ logger: {
+ infrastructure: 'silent',
+ },
+ }),
+ !disableESLintPlugin &&
+ new ESLintPlugin({
+ // Plugin options
+ extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
+ formatter: require.resolve('react-dev-utils/eslintFormatter'),
+ eslintPath: require.resolve('eslint'),
+ failOnError: !(isEnvDevelopment && emitErrorsAsWarnings),
+ context: paths.appSrc,
+ cache: true,
+ cacheLocation: path.resolve(
+ paths.appNodeModules,
+ '.cache/.eslintcache'
+ ),
+ // ESLint class options
+ cwd: paths.appPath,
+ resolvePluginsRelativeTo: __dirname,
+ baseConfig: {
+ extends: [require.resolve('eslint-config-react-app/base')],
+ rules: {
+ ...(!hasJsxRuntime && {
+ 'react/react-in-jsx-scope': 'error',
+ }),
+ },
+ },
+ }),
+ ].filter(Boolean),
+ // Turn off performance processing because we utilize
+ // our own hints via the FileSizeReporter
+ performance: false,
+ };
};
diff --git a/packages/player-example/package.json b/packages/player-example/package.json
index 0d34726860..2cadaf64ca 100644
--- a/packages/player-example/package.json
+++ b/packages/player-example/package.json
@@ -11,18 +11,11 @@
"@babel/core": "^7.16.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@remotion/player": "2.6.15",
- "@svgr/webpack": "^5.5.0",
- "@testing-library/jest-dom": "^5.11.4",
- "@testing-library/react": "13.0.0",
- "@testing-library/user-event": "14.0.4",
- "@types/jest": "^27.4.0",
"@types/node": "^12.0.0",
"@types/react": "18.0.1",
"@types/react-dom": "18.0.0",
"babel-loader": "^8.2.3",
- "babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1",
- "bfj": "^7.0.2",
"browserslist": "^4.18.1",
"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
diff --git a/packages/player-example/scripts/build.js b/packages/player-example/scripts/build.js
index 8a9acaaf70..877afec7a2 100644
--- a/packages/player-example/scripts/build.js
+++ b/packages/player-example/scripts/build.js
@@ -7,13 +7,10 @@ process.env.NODE_ENV = 'production';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
-process.on('unhandledRejection', err => {
- throw err;
+process.on('unhandledRejection', (err) => {
+ throw err;
});
-// Ensure environment variables are read.
-require('../config/env');
-
const path = require('path');
const chalk = require('react-dev-utils/chalk');
const fs = require('fs-extra');
@@ -28,7 +25,7 @@ const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const measureFileSizesBeforeBuild =
- FileSizeReporter.measureFileSizesBeforeBuild;
+ FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
@@ -40,178 +37,170 @@ const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
- process.exit(1);
+ process.exit(1);
}
const argv = process.argv.slice(2);
-const writeStatsJson = argv.indexOf('--stats') !== -1;
// Generate configuration
const config = configFactory('production');
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
-const { checkBrowsers } = require('react-dev-utils/browsersHelper');
+const {checkBrowsers} = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
- .then(() => {
- // First, read the current file sizes in build directory.
- // This lets us display how much they changed later.
- return measureFileSizesBeforeBuild(paths.appBuild);
- })
- .then(previousFileSizes => {
- // Remove all content but keep the directory so that
- // if you're in it, you don't end up in Trash
- fs.emptyDirSync(paths.appBuild);
- // Merge with the public folder
- copyPublicFolder();
- // Start the webpack build
- return build(previousFileSizes);
- })
- .then(
- ({ stats, previousFileSizes, warnings }) => {
- if (warnings.length) {
- console.log(chalk.yellow('Compiled with warnings.\n'));
- console.log(warnings.join('\n\n'));
- console.log(
- '\nSearch for the ' +
- chalk.underline(chalk.yellow('keywords')) +
- ' to learn more about each warning.'
- );
- console.log(
- 'To ignore, add ' +
- chalk.cyan('// eslint-disable-next-line') +
- ' to the line before.\n'
- );
- } else {
- console.log(chalk.green('Compiled successfully.\n'));
- }
-
- console.log('File sizes after gzip:\n');
- printFileSizesAfterBuild(
- stats,
- previousFileSizes,
- paths.appBuild,
- WARN_AFTER_BUNDLE_GZIP_SIZE,
- WARN_AFTER_CHUNK_GZIP_SIZE
- );
- console.log();
-
- const appPackage = require(paths.appPackageJson);
- const publicUrl = paths.publicUrlOrPath;
- const publicPath = config.output.publicPath;
- const buildFolder = path.relative(process.cwd(), paths.appBuild);
- printHostingInstructions(
- appPackage,
- publicUrl,
- publicPath,
- buildFolder,
- useYarn
- );
- },
- err => {
- const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
- if (tscCompileOnError) {
- console.log(
- chalk.yellow(
- 'Compiled with the following type errors (you may want to check these before deploying your app):\n'
- )
- );
- printBuildError(err);
- } else {
- console.log(chalk.red('Failed to compile.\n'));
- printBuildError(err);
- process.exit(1);
- }
- }
- )
- .catch(err => {
- if (err && err.message) {
- console.log(err.message);
- }
- process.exit(1);
- });
+ .then(() => {
+ // First, read the current file sizes in build directory.
+ // This lets us display how much they changed later.
+ return measureFileSizesBeforeBuild(paths.appBuild);
+ })
+ .then((previousFileSizes) => {
+ // Remove all content but keep the directory so that
+ // if you're in it, you don't end up in Trash
+ fs.emptyDirSync(paths.appBuild);
+ // Merge with the public folder
+ copyPublicFolder();
+ // Start the webpack build
+ return build(previousFileSizes);
+ })
+ .then(
+ ({stats, previousFileSizes, warnings}) => {
+ if (warnings.length) {
+ console.log(chalk.yellow('Compiled with warnings.\n'));
+ console.log(warnings.join('\n\n'));
+ console.log(
+ '\nSearch for the ' +
+ chalk.underline(chalk.yellow('keywords')) +
+ ' to learn more about each warning.'
+ );
+ console.log(
+ 'To ignore, add ' +
+ chalk.cyan('// eslint-disable-next-line') +
+ ' to the line before.\n'
+ );
+ } else {
+ console.log(chalk.green('Compiled successfully.\n'));
+ }
+
+ console.log('File sizes after gzip:\n');
+ printFileSizesAfterBuild(
+ stats,
+ previousFileSizes,
+ paths.appBuild,
+ WARN_AFTER_BUNDLE_GZIP_SIZE,
+ WARN_AFTER_CHUNK_GZIP_SIZE
+ );
+ console.log();
+
+ const appPackage = require(paths.appPackageJson);
+ const publicUrl = paths.publicUrlOrPath;
+ const publicPath = config.output.publicPath;
+ const buildFolder = path.relative(process.cwd(), paths.appBuild);
+ printHostingInstructions(
+ appPackage,
+ publicUrl,
+ publicPath,
+ buildFolder,
+ useYarn
+ );
+ },
+ (err) => {
+ const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
+ if (tscCompileOnError) {
+ console.log(
+ chalk.yellow(
+ 'Compiled with the following type errors (you may want to check these before deploying your app):\n'
+ )
+ );
+ printBuildError(err);
+ } else {
+ console.log(chalk.red('Failed to compile.\n'));
+ printBuildError(err);
+ process.exit(1);
+ }
+ }
+ )
+ .catch((err) => {
+ if (err && err.message) {
+ console.log(err.message);
+ }
+ process.exit(1);
+ });
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
- console.log('Creating an optimized production build...');
-
- const compiler = webpack(config);
- return new Promise((resolve, reject) => {
- compiler.run((err, stats) => {
- let messages;
- if (err) {
- if (!err.message) {
- return reject(err);
- }
-
- let errMessage = err.message;
-
- // Add additional information for postcss errors
- if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
- errMessage +=
- '\nCompileError: Begins at CSS selector ' +
- err['postcssNode'].selector;
- }
-
- messages = formatWebpackMessages({
- errors: [errMessage],
- warnings: [],
- });
- } else {
- messages = formatWebpackMessages(
- stats.toJson({ all: false, warnings: true, errors: true })
- );
- }
- if (messages.errors.length) {
- // Only keep the first error. Others are often indicative
- // of the same problem, but confuse the reader with noise.
- if (messages.errors.length > 1) {
- messages.errors.length = 1;
- }
- return reject(new Error(messages.errors.join('\n\n')));
- }
- if (
- process.env.CI &&
- (typeof process.env.CI !== 'string' ||
- process.env.CI.toLowerCase() !== 'false') &&
- messages.warnings.length
- ) {
- // Ignore sourcemap warnings in CI builds. See #8227 for more info.
- const filteredWarnings = messages.warnings.filter(
- w => !/Failed to parse source map/.test(w)
- );
- if (filteredWarnings.length) {
- console.log(
- chalk.yellow(
- '\nTreating warnings as errors because process.env.CI = true.\n' +
- 'Most CI servers set it automatically.\n'
- )
- );
- return reject(new Error(filteredWarnings.join('\n\n')));
- }
- }
-
- const resolveArgs = {
- stats,
- previousFileSizes,
- warnings: messages.warnings,
- };
-
- if (writeStatsJson) {
- return bfj
- .write(paths.appBuild + '/bundle-stats.json', stats.toJson())
- .then(() => resolve(resolveArgs))
- .catch(error => reject(new Error(error)));
- }
-
- return resolve(resolveArgs);
- });
- });
+ console.log('Creating an optimized production build...');
+
+ const compiler = webpack(config);
+ return new Promise((resolve, reject) => {
+ compiler.run((err, stats) => {
+ let messages;
+ if (err) {
+ if (!err.message) {
+ return reject(err);
+ }
+
+ let errMessage = err.message;
+
+ // Add additional information for postcss errors
+ if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
+ errMessage +=
+ '\nCompileError: Begins at CSS selector ' +
+ err['postcssNode'].selector;
+ }
+
+ messages = formatWebpackMessages({
+ errors: [errMessage],
+ warnings: [],
+ });
+ } else {
+ messages = formatWebpackMessages(
+ stats.toJson({all: false, warnings: true, errors: true})
+ );
+ }
+ if (messages.errors.length) {
+ // Only keep the first error. Others are often indicative
+ // of the same problem, but confuse the reader with noise.
+ if (messages.errors.length > 1) {
+ messages.errors.length = 1;
+ }
+ return reject(new Error(messages.errors.join('\n\n')));
+ }
+ if (
+ process.env.CI &&
+ (typeof process.env.CI !== 'string' ||
+ process.env.CI.toLowerCase() !== 'false') &&
+ messages.warnings.length
+ ) {
+ // Ignore sourcemap warnings in CI builds. See #8227 for more info.
+ const filteredWarnings = messages.warnings.filter(
+ (w) => !/Failed to parse source map/.test(w)
+ );
+ if (filteredWarnings.length) {
+ console.log(
+ chalk.yellow(
+ '\nTreating warnings as errors because process.env.CI = true.\n' +
+ 'Most CI servers set it automatically.\n'
+ )
+ );
+ return reject(new Error(filteredWarnings.join('\n\n')));
+ }
+ }
+
+ const resolveArgs = {
+ stats,
+ previousFileSizes,
+ warnings: messages.warnings,
+ };
+
+ return resolve(resolveArgs);
+ });
+ });
}
function copyPublicFolder() {
- fs.copySync(paths.appPublic, paths.appBuild, {
- dereference: true,
- filter: file => file !== paths.appHtml,
- });
+ fs.copySync(paths.appPublic, paths.appBuild, {
+ dereference: true,
+ filter: (file) => file !== paths.appHtml,
+ });
}
diff --git a/packages/player-example/scripts/start.js b/packages/player-example/scripts/start.js
index 41047988fa..fd0a97cdcc 100644
--- a/packages/player-example/scripts/start.js
+++ b/packages/player-example/scripts/start.js
@@ -7,13 +7,10 @@ process.env.NODE_ENV = 'development';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
-process.on('unhandledRejection', err => {
- throw err;
+process.on('unhandledRejection', (err) => {
+ throw err;
});
-// Ensure environment variables are read.
-require('../config/env');
-
const fs = require('fs');
const chalk = require('react-dev-utils/chalk');
const webpack = require('webpack');
@@ -21,10 +18,10 @@ const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const {
- choosePort,
- createCompiler,
- prepareProxy,
- prepareUrls,
+ choosePort,
+ createCompiler,
+ prepareProxy,
+ prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const semver = require('semver');
@@ -32,7 +29,7 @@ const paths = require('../config/paths');
const configFactory = require('../config/webpack.config');
const createDevServerConfig = require('../config/webpackDevServer.config');
const getClientEnvironment = require('../config/env');
-const react = require(require.resolve('react', { paths: [paths.appPath] }));
+const react = require(require.resolve('react', {paths: [paths.appPath]}));
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
const useYarn = fs.existsSync(paths.yarnLockFile);
@@ -40,7 +37,7 @@ const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
- process.exit(1);
+ process.exit(1);
}
// Tools like Cloud9 rely on this.
@@ -48,107 +45,107 @@ const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
- console.log(
- chalk.cyan(
- `Attempting to bind to HOST environment variable: ${chalk.yellow(
- chalk.bold(process.env.HOST)
- )}`
- )
- );
- console.log(
- `If this was unintentional, check that you haven't mistakenly set it in your shell.`
- );
- console.log(
- `Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`
- );
- console.log();
+ console.log(
+ chalk.cyan(
+ `Attempting to bind to HOST environment variable: ${chalk.yellow(
+ chalk.bold(process.env.HOST)
+ )}`
+ )
+ );
+ console.log(
+ `If this was unintentional, check that you haven't mistakenly set it in your shell.`
+ );
+ console.log(
+ `Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`
+ );
+ console.log();
}
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
-const { checkBrowsers } = require('react-dev-utils/browsersHelper');
+const {checkBrowsers} = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
- .then(() => {
- // We attempt to use the default port but if it is busy, we offer the user to
- // run on a different port. `choosePort()` Promise resolves to the next free port.
- return choosePort(HOST, DEFAULT_PORT);
- })
- .then(port => {
- if (port == null) {
- // We have not found a port.
- return;
- }
+ .then(() => {
+ // We attempt to use the default port but if it is busy, we offer the user to
+ // run on a different port. `choosePort()` Promise resolves to the next free port.
+ return choosePort(HOST, DEFAULT_PORT);
+ })
+ .then((port) => {
+ if (port == null) {
+ // We have not found a port.
+ return;
+ }
- const config = configFactory('development');
- const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
- const appName = require(paths.appPackageJson).name;
+ const config = configFactory('development');
+ const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
+ const appName = require(paths.appPackageJson).name;
- const useTypeScript = fs.existsSync(paths.appTsConfig);
- const urls = prepareUrls(
- protocol,
- HOST,
- port,
- paths.publicUrlOrPath.slice(0, -1)
- );
- // Create a webpack compiler that is configured with custom messages.
- const compiler = createCompiler({
- appName,
- config,
- urls,
- useYarn,
- useTypeScript,
- webpack,
- });
- // Load proxy config
- const proxySetting = require(paths.appPackageJson).proxy;
- const proxyConfig = prepareProxy(
- proxySetting,
- paths.appPublic,
- paths.publicUrlOrPath
- );
- // Serve webpack assets generated by the compiler over a web server.
- const serverConfig = {
- ...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
- host: HOST,
- port,
- };
- const devServer = new WebpackDevServer(serverConfig, compiler);
- // Launch WebpackDevServer.
- devServer.startCallback(() => {
- if (isInteractive) {
- clearConsole();
- }
+ const useTypeScript = fs.existsSync(paths.appTsConfig);
+ const urls = prepareUrls(
+ protocol,
+ HOST,
+ port,
+ paths.publicUrlOrPath.slice(0, -1)
+ );
+ // Create a webpack compiler that is configured with custom messages.
+ const compiler = createCompiler({
+ appName,
+ config,
+ urls,
+ useYarn,
+ useTypeScript,
+ webpack,
+ });
+ // Load proxy config
+ const proxySetting = require(paths.appPackageJson).proxy;
+ const proxyConfig = prepareProxy(
+ proxySetting,
+ paths.appPublic,
+ paths.publicUrlOrPath
+ );
+ // Serve webpack assets generated by the compiler over a web server.
+ const serverConfig = {
+ ...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
+ host: HOST,
+ port,
+ };
+ const devServer = new WebpackDevServer(serverConfig, compiler);
+ // Launch WebpackDevServer.
+ devServer.startCallback(() => {
+ if (isInteractive) {
+ clearConsole();
+ }
- if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
- console.log(
- chalk.yellow(
- `Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
- )
- );
- }
+ if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
+ console.log(
+ chalk.yellow(
+ `Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
+ )
+ );
+ }
- console.log(chalk.cyan('Starting the development server...\n'));
- openBrowser(urls.localUrlForBrowser);
- });
+ console.log(chalk.cyan('Starting the development server...\n'));
+ openBrowser(urls.localUrlForBrowser);
+ });
- ['SIGINT', 'SIGTERM'].forEach(function (sig) {
- process.on(sig, function () {
- devServer.close();
- process.exit();
- });
- });
+ ['SIGINT', 'SIGTERM'].forEach(function (sig) {
+ process.on(sig, function () {
+ devServer.close();
+ process.exit();
+ });
+ });
- if (process.env.CI !== 'true') {
- // Gracefully exit when stdin ends
- process.stdin.on('end', function () {
- devServer.close();
- process.exit();
- });
- }
- })
- .catch(err => {
- if (err && err.message) {
- console.log(err.message);
- }
- process.exit(1);
- });
+ if (process.env.CI !== 'true') {
+ // Gracefully exit when stdin ends
+ process.stdin.on('end', function () {
+ devServer.close();
+ process.exit();
+ });
+ }
+ })
+ .catch((err) => {
+ if (err && err.message) {
+ console.log(err.message);
+ }
+ process.exit(1);
+ });
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d1a9742b2f..ff7d31a7d2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -667,18 +667,11 @@ importers:
'@pmmmwh/react-refresh-webpack-plugin': ^0.5.3
'@remotion/eslint-config': 2.6.15
'@remotion/player': 2.6.15
- '@svgr/webpack': ^5.5.0
- '@testing-library/jest-dom': ^5.11.4
- '@testing-library/react': 13.0.0
- '@testing-library/user-event': 14.0.4
- '@types/jest': ^27.4.0
'@types/node': ^12.0.0
'@types/react': 18.0.1
'@types/react-dom': 18.0.0
babel-loader: ^8.2.3
- babel-plugin-named-asset-import: ^0.3.8
babel-preset-react-app: ^10.0.1
- bfj: ^7.0.2
browserslist: ^4.18.1
camelcase: ^6.2.1
case-sensitive-paths-webpack-plugin: ^2.4.0
@@ -723,18 +716,11 @@ importers:
'@pmmmwh/react-refresh-webpack-plugin': 0.5.5_71ded90fc5f197eeccab1f0382e7a4aa
'@remotion/eslint-config': link:../eslint-config
'@remotion/player': link:../player
- '@svgr/webpack': 5.5.0
- '@testing-library/jest-dom': 5.14.1
- '@testing-library/react': [email protected][email protected]
- '@testing-library/user-event': 14.0.4
- '@types/jest': 27.4.0
'@types/node': 12.20.27
'@types/react': 18.0.1
'@types/react-dom': 18.0.0
babel-loader: 8.2.4_acba72ea4bf9d339cdfcd8f55cdb7006
- babel-plugin-named-asset-import: 0.3.8_@[email protected]
babel-preset-react-app: 10.0.1
- bfj: 7.0.2
browserslist: 4.20.2
camelcase: 6.3.0
case-sensitive-paths-webpack-plugin: 2.4.0
@@ -5299,6 +5285,7 @@ packages:
dependencies:
core-js-pure: 3.21.1
regenerator-runtime: 0.13.9
+ dev: true
/@babel/runtime-corejs3/7.17.9:
resolution: {integrity: sha512-WxYHHUWF2uZ7Hp1K+D1xQgbgkGUfA+5UPOegEXGt2Y5SMog/rYCVaifLZDbw8UkNXozEqqrZTy6bglL7xTaCOw==}
@@ -7639,11 +7626,6 @@ packages:
string.prototype.matchall: 4.0.6
dev: false
- /@svgr/babel-plugin-add-jsx-attribute/5.4.0:
- resolution: {integrity: sha512-ZFf2gs/8/6B8PnSofI0inYXr2SDNTDScPXhN7k5EqD4aZ3gi6u+rbmZHVB8IM3wDyx8ntKACZbtXSm7oZGRqVg==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-add-jsx-attribute/6.0.0_@[email protected]:
resolution: {integrity: sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==}
engines: {node: '>=10'}
@@ -7653,11 +7635,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-remove-jsx-attribute/5.4.0:
- resolution: {integrity: sha512-yaS4o2PgUtwLFGTKbsiAy6D0o3ugcUhWK0Z45umJ66EPWunAz9fuFw2gJuje6wqQvQWOTJvIahUwndOXb7QCPg==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-remove-jsx-attribute/6.0.0_@[email protected]:
resolution: {integrity: sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==}
engines: {node: '>=10'}
@@ -7667,11 +7644,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-remove-jsx-empty-expression/5.0.1:
- resolution: {integrity: sha512-LA72+88A11ND/yFIMzyuLRSMJ+tRKeYKeQ+mR3DcAZ5I4h5CPWN9AHyUzJbWSYp/u2u0xhmgOe0+E41+GjEueA==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-remove-jsx-empty-expression/6.0.0_@[email protected]:
resolution: {integrity: sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==}
engines: {node: '>=10'}
@@ -7681,11 +7653,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-replace-jsx-attribute-value/5.0.1:
- resolution: {integrity: sha512-PoiE6ZD2Eiy5mK+fjHqwGOS+IXX0wq/YDtNyIgOrc6ejFnxN4b13pRpiIPbtPwHEc+NT2KCjteAcq33/F1Y9KQ==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-replace-jsx-attribute-value/6.0.0_@[email protected]:
resolution: {integrity: sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==}
engines: {node: '>=10'}
@@ -7695,11 +7662,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-svg-dynamic-title/5.4.0:
- resolution: {integrity: sha512-zSOZH8PdZOpuG1ZVx/cLVePB2ibo3WPpqo7gFIjLV9a0QsuQAzJiwwqmuEdTaW2pegyBE17Uu15mOgOcgabQZg==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-svg-dynamic-title/6.0.0_@[email protected]:
resolution: {integrity: sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==}
engines: {node: '>=10'}
@@ -7709,11 +7671,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-svg-em-dimensions/5.4.0:
- resolution: {integrity: sha512-cPzDbDA5oT/sPXDCUYoVXEmm3VIoAWAPT6mSPTJNbQaBNUuEKVKyGH93oDY4e42PYHRW67N5alJx/eEol20abw==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-svg-em-dimensions/6.0.0_@[email protected]:
resolution: {integrity: sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==}
engines: {node: '>=10'}
@@ -7723,11 +7680,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-transform-react-native-svg/5.4.0:
- resolution: {integrity: sha512-3eYP/SaopZ41GHwXma7Rmxcv9uRslRDTY1estspeB1w1ueZWd/tPlMfEOoccYpEMZU3jD4OU7YitnXcF5hLW2Q==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-transform-react-native-svg/6.0.0_@[email protected]:
resolution: {integrity: sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==}
engines: {node: '>=10'}
@@ -7737,11 +7689,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-plugin-transform-svg-component/5.5.0:
- resolution: {integrity: sha512-q4jSH1UUvbrsOtlo/tKcgSeiCHRSBdXoIoqX1pgcKK/aU3JD27wmMKwGtpB8qRYUYoyXvfGxUVKchLuR5pB3rQ==}
- engines: {node: '>=10'}
- dev: false
-
/@svgr/babel-plugin-transform-svg-component/6.2.0_@[email protected]:
resolution: {integrity: sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==}
engines: {node: '>=12'}
@@ -7751,20 +7698,6 @@ packages:
'@babel/core': 7.17.9
dev: false
- /@svgr/babel-preset/5.5.0:
- resolution: {integrity: sha512-4FiXBjvQ+z2j7yASeGPEi8VD/5rrGQk4Xrq3EdJmoZgz/tpqChpo5hgXDvmEauwtvOc52q8ghhZK4Oy7qph4ig==}
- engines: {node: '>=10'}
- dependencies:
- '@svgr/babel-plugin-add-jsx-attribute': 5.4.0
- '@svgr/babel-plugin-remove-jsx-attribute': 5.4.0
- '@svgr/babel-plugin-remove-jsx-empty-expression': 5.0.1
- '@svgr/babel-plugin-replace-jsx-attribute-value': 5.0.1
- '@svgr/babel-plugin-svg-dynamic-title': 5.4.0
- '@svgr/babel-plugin-svg-em-dimensions': 5.4.0
- '@svgr/babel-plugin-transform-react-native-svg': 5.4.0
- '@svgr/babel-plugin-transform-svg-component': 5.5.0
- dev: false
-
/@svgr/babel-preset/6.2.0_@[email protected]:
resolution: {integrity: sha512-4WQNY0J71JIaL03DRn0vLiz87JXx0b9dYm2aA8XHlQJQoixMl4r/soYHm8dsaJZ3jWtkCiOYy48dp9izvXhDkQ==}
engines: {node: '>=10'}
@@ -7782,17 +7715,6 @@ packages:
'@svgr/babel-plugin-transform-svg-component': 6.2.0_@[email protected]
dev: false
- /@svgr/core/5.5.0:
- resolution: {integrity: sha512-q52VOcsJPvV3jO1wkPtzTuKlvX7Y3xIcWRpCMtBF3MrteZJtBfQw/+u0B1BHy5ColpQc1/YVTrPEtSYIMNZlrQ==}
- engines: {node: '>=10'}
- dependencies:
- '@svgr/plugin-jsx': 5.5.0
- camelcase: 6.3.0
- cosmiconfig: 7.0.1
- transitivePeerDependencies:
- - supports-color
- dev: false
-
/@svgr/core/6.2.1:
resolution: {integrity: sha512-NWufjGI2WUyrg46mKuySfviEJ6IxHUOm/8a3Ph38VCWSp+83HBraCQrpEM3F3dB6LBs5x8OElS8h3C0oOJaJAA==}
engines: {node: '>=10'}
@@ -7804,13 +7726,6 @@ packages:
- supports-color
dev: false
- /@svgr/hast-util-to-babel-ast/5.5.0:
- resolution: {integrity: sha512-cAaR/CAiZRB8GP32N+1jocovUtvlj0+e65TB50/6Lcime+EA49m/8l+P2ko+XPJ4dw3xaPS3jOL4F2X4KWxoeQ==}
- engines: {node: '>=10'}
- dependencies:
- '@babel/types': 7.17.0
- dev: false
-
/@svgr/hast-util-to-babel-ast/6.2.1:
resolution: {integrity: sha512-pt7MMkQFDlWJVy9ULJ1h+hZBDGFfSCwlBNW1HkLnVi7jUhyEXUaGYWi1x6bM2IXuAR9l265khBT4Av4lPmaNLQ==}
engines: {node: '>=10'}
@@ -7819,18 +7734,6 @@ packages:
entities: 3.0.1
dev: false
- /@svgr/plugin-jsx/5.5.0:
- resolution: {integrity: sha512-V/wVh33j12hGh05IDg8GpIUXbjAPnTdPTKuP4VNLggnwaHMPNQNae2pRnyTAILWCQdz5GyMqtO488g7CKM8CBA==}
- engines: {node: '>=10'}
- dependencies:
- '@babel/core': 7.17.9
- '@svgr/babel-preset': 5.5.0
- '@svgr/hast-util-to-babel-ast': 5.5.0
- svg-parser: 2.0.4
- transitivePeerDependencies:
- - supports-color
- dev: false
-
/@svgr/plugin-jsx/6.2.1_@[email protected]:
resolution: {integrity: sha512-u+MpjTsLaKo6r3pHeeSVsh9hmGRag2L7VzApWIaS8imNguqoUwDq/u6U/NDmYs/KAsrmtBjOEaAAPbwNGXXp1g==}
engines: {node: '>=10'}
@@ -7846,15 +7749,6 @@ packages:
- supports-color
dev: false
- /@svgr/plugin-svgo/5.5.0:
- resolution: {integrity: sha512-r5swKk46GuQl4RrVejVwpeeJaydoxkdwkM1mBKOgJLBUJPGaLci6ylg/IjhrRsREKDkr4kbMWdgOtbXEh0fyLQ==}
- engines: {node: '>=10'}
- dependencies:
- cosmiconfig: 7.0.1
- deepmerge: 4.2.2
- svgo: 1.3.2
- dev: false
-
/@svgr/plugin-svgo/6.2.0_@[email protected]:
resolution: {integrity: sha512-oDdMQONKOJEbuKwuy4Np6VdV6qoaLLvoY86hjvQEgU82Vx1MSWRyYms6Sl0f+NtqxLI/rDVufATbP/ev996k3Q==}
engines: {node: '>=10'}
@@ -7867,22 +7761,6 @@ packages:
svgo: 2.7.0
dev: false
- /@svgr/webpack/5.5.0:
- resolution: {integrity: sha512-DOBOK255wfQxguUta2INKkzPj6AIS6iafZYiYmHn6W3pHlycSRRlvWKCfLDG10fXfLWqE3DJHgRUOyJYmARa7g==}
- engines: {node: '>=10'}
- dependencies:
- '@babel/core': 7.17.9
- '@babel/plugin-transform-react-constant-elements': 7.14.5_@[email protected]
- '@babel/preset-env': 7.16.11_@[email protected]
- '@babel/preset-react': 7.16.7_@[email protected]
- '@svgr/core': 5.5.0
- '@svgr/plugin-jsx': 5.5.0
- '@svgr/plugin-svgo': 5.5.0
- loader-utils: 2.0.0
- transitivePeerDependencies:
- - supports-color
- dev: false
-
/@svgr/webpack/6.2.1:
resolution: {integrity: sha512-h09ngMNd13hnePwgXa+Y5CgOjzlCvfWLHg+MBnydEedAnuLRzUHUJmGS3o2OsrhxTOOqEsPOFt5v/f6C5Qulcw==}
engines: {node: '>=10'}
@@ -7918,21 +7796,7 @@ packages:
dom-accessibility-api: 0.5.7
lz-string: 1.4.4
pretty-format: 27.2.4
-
- /@testing-library/jest-dom/5.14.1:
- resolution: {integrity: sha512-dfB7HVIgTNCxH22M1+KU6viG5of2ldoA5ly8Ar8xkezKHKXjRvznCdbMbqjYGgO2xjRbwnR+rR8MLUIqF3kKbQ==}
- engines: {node: '>=8', npm: '>=6', yarn: '>=1'}
- dependencies:
- '@babel/runtime': 7.15.4
- '@types/testing-library__jest-dom': 5.14.1
- aria-query: 4.2.2
- chalk: 3.0.0
- css: 3.0.0
- css.escape: 1.5.1
- dom-accessibility-api: 0.5.7
- lodash: 4.17.21
- redent: 3.0.0
- dev: false
+ dev: true
/@testing-library/react-hooks/[email protected][email protected]:
resolution: {integrity: sha512-UdEUtlQapQ579NEcXDAUE275u+KUsPtxW7NmFrNt0bE6lW8lqNCyxDK0RSuECmNZ/S0/fgP00W9RWRhVKO/hRg==}
@@ -7980,13 +7844,7 @@ packages:
'@types/react-dom': 18.0.0
react: 18.0.0
react-dom: [email protected]
-
- /@testing-library/user-event/14.0.4:
- resolution: {integrity: sha512-VBZe5lcUsmrQyOwIFvqOxLBoaTw1/Qy4Ek+VgmFYs719bs2SxUp42vbsb7ATlQDkHdj4OIQlucfpwxe5WoG1jA==}
- engines: {node: '>=12', npm: '>=6'}
- peerDependencies:
- '@testing-library/dom': '>=7.21.4'
- dev: false
+ dev: true
/@tootallnate/once/1.1.2:
resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==}
@@ -8003,6 +7861,7 @@ packages:
/@types/aria-query/4.2.2:
resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==}
+ dev: true
/@types/babel__core/7.1.16:
resolution: {integrity: sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==}
@@ -8245,10 +8104,6 @@ packages:
/@types/prop-types/15.7.4:
resolution: {integrity: sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==}
- /@types/q/1.5.5:
- resolution: {integrity: sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==}
- dev: false
-
/@types/qs/6.9.7:
resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==}
@@ -8377,12 +8232,6 @@ packages:
'@types/node': 17.0.17
dev: true
- /@types/testing-library__jest-dom/5.14.1:
- resolution: {integrity: sha512-Gk9vaXfbzc5zCXI9eYE9BI5BNHEp4D3FWjgqBE/ePGYElLAP+KvxBcsdkwfIVvezs605oiyd/VrpiHe3Oeg+Aw==}
- dependencies:
- '@types/jest': 27.4.0
- dev: false
-
/@types/three/0.134.0:
resolution: {integrity: sha512-4YB+99Rgqq27EjiYTItEoZtdjLnTh8W9LxowgpC9eWsjaQJIL4Kn/ZcUKAnW3gB/jS4hqGN8iqmid+RcUZDzpA==}
dev: true
@@ -9117,6 +8966,7 @@ packages:
dependencies:
'@babel/runtime': 7.15.4
'@babel/runtime-corejs3': 7.15.4
+ dev: true
/arr-diff/4.0.0:
resolution: {integrity: sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=}
@@ -9391,14 +9241,6 @@ packages:
resolve: 1.22.0
dev: false
- /babel-plugin-named-asset-import/0.3.8_@[email protected]:
- resolution: {integrity: sha512-WXiAc++qo7XcJ1ZnTYGtLxmBCVbddAml3CEXgWaBzNzLNoxtQ8AiGEFDMOhot9XjTCQbvP5E77Fj9Gk924f00Q==}
- peerDependencies:
- '@babel/core': ^7.1.0
- dependencies:
- '@babel/core': 7.17.9
- dev: false
-
/babel-plugin-polyfill-corejs2/0.2.2_@[email protected]:
resolution: {integrity: sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==}
peerDependencies:
@@ -9591,16 +9433,6 @@ packages:
open: 7.4.2
dev: false
- /bfj/7.0.2:
- resolution: {integrity: sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw==}
- engines: {node: '>= 8.0.0'}
- dependencies:
- bluebird: 3.7.2
- check-types: 11.1.2
- hoopy: 0.1.4
- tryer: 1.0.1
- dev: false
-
/bidi-js/1.0.2:
resolution: {integrity: sha512-rzSy/k7WdX5zOyeHHCOixGXbCHkyogkxPKL2r8QtzHmVQDiWCXUWa18bLdMWT9CYMLOYTjWpTHawuev2ouYJVw==}
dependencies:
@@ -9976,14 +9808,6 @@ packages:
escape-string-regexp: 1.0.5
supports-color: 5.5.0
- /chalk/3.0.0:
- resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==}
- engines: {node: '>=8'}
- dependencies:
- ansi-styles: 4.3.0
- supports-color: 7.2.0
- dev: false
-
/chalk/4.1.2:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
engines: {node: '>=10'}
@@ -10039,10 +9863,6 @@ packages:
resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
dev: false
- /check-types/11.1.2:
- resolution: {integrity: sha512-tzWzvgePgLORb9/3a0YenggReLKAIb2owL03H2Xdoe5pKcUyWRSEQ8xfCar8t2SIAuEDwtmx2da1YB52YuHQMQ==}
- dev: false
-
/cheerio-select/1.6.0:
resolution: {integrity: sha512-eq0GdBvxVFbqWgmCm7M3XGs1I8oLy/nExUnh6oLqmBditPO9AqQJrkslDpMun/hZ0yyTs8L0m85OHp4ho6Qm9g==}
dependencies:
@@ -10242,15 +10062,6 @@ packages:
resolution: {integrity: sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=}
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
- /coa/2.0.2:
- resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==}
- engines: {node: '>= 4.0'}
- dependencies:
- '@types/q': 1.5.5
- chalk: 2.4.2
- q: 1.5.1
- dev: false
-
/code-point-at/1.1.0:
resolution: {integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=}
engines: {node: '>=0.10.0'}
@@ -10824,10 +10635,6 @@ packages:
postcss: 8.4.12
dev: false
- /css-select-base-adapter/0.1.1:
- resolution: {integrity: sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==}
- dev: false
-
/css-select/1.2.0:
resolution: {integrity: sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=}
dependencies:
@@ -10837,15 +10644,6 @@ packages:
nth-check: 1.0.2
dev: false
- /css-select/2.1.0:
- resolution: {integrity: sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==}
- dependencies:
- boolbase: 1.0.0
- css-what: 3.4.2
- domutils: 1.7.0
- nth-check: 1.0.2
- dev: false
-
/css-select/4.3.0:
resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==}
dependencies:
@@ -10864,14 +10662,6 @@ packages:
postcss-value-parser: 4.1.0
dev: false
- /css-tree/1.0.0-alpha.37:
- resolution: {integrity: sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==}
- engines: {node: '>=8.0.0'}
- dependencies:
- mdn-data: 2.0.4
- source-map: 0.6.1
- dev: false
-
/css-tree/1.1.3:
resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==}
engines: {node: '>=8.0.0'}
@@ -10884,28 +10674,11 @@ packages:
resolution: {integrity: sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==}
dev: false
- /css-what/3.4.2:
- resolution: {integrity: sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==}
- engines: {node: '>= 6'}
- dev: false
-
/css-what/6.1.0:
resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==}
engines: {node: '>= 6'}
dev: false
- /css.escape/1.5.1:
- resolution: {integrity: sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=}
- dev: false
-
- /css/3.0.0:
- resolution: {integrity: sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==}
- dependencies:
- inherits: 2.0.4
- source-map: 0.6.1
- source-map-resolve: 0.6.0
- dev: false
-
/cssdb/6.5.0:
resolution: {integrity: sha512-Rh7AAopF2ckPXe/VBcoUS9JrCZNSyc60+KpgE6X25vpVxA32TmiqvExjkfhwP4wGSb6Xe8Z/JIyGqwgx/zZYFA==}
dev: false
@@ -11360,6 +11133,7 @@ packages:
/dom-accessibility-api/0.5.7:
resolution: {integrity: sha512-ml3lJIq9YjUfM9TUnEPvEYWFSwivwIGBPKpewX7tii7fwCazA8yCioGdqQcNsItPpfFvSJ3VIdMQPj60LJhcQA==}
+ dev: true
/dom-converter/0.2.0:
resolution: {integrity: sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==}
@@ -13299,11 +13073,6 @@ packages:
react-is: 16.13.1
dev: false
- /hoopy/0.1.4:
- resolution: {integrity: sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==}
- engines: {node: '>= 6.0.0'}
- dev: false
-
/hosted-git-info/2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
dev: false
@@ -15426,10 +15195,6 @@ packages:
resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==}
dev: false
- /mdn-data/2.0.4:
- resolution: {integrity: sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==}
- dev: false
-
/mdurl/1.0.1:
resolution: {integrity: sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=}
dev: false
@@ -19614,13 +19379,6 @@ packages:
urix: 0.1.0
dev: false
- /source-map-resolve/0.6.0:
- resolution: {integrity: sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==}
- dependencies:
- atob: 2.1.2
- decode-uri-component: 0.2.0
- dev: false
-
/source-map-support/0.5.20:
resolution: {integrity: sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==}
dependencies:
@@ -20056,27 +19814,6 @@ packages:
resolution: {integrity: sha512-Wo6SjzONZPL9UAgrnwcCkDGRYP9CbHJGkNcPFIgEVRjiOiJxSd/AtwnGk/4N4iOLGUoas57TMxY0xASDeb9YJg==}
dev: false
- /svgo/1.3.2:
- resolution: {integrity: sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==}
- engines: {node: '>=4.0.0'}
- deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x.
- hasBin: true
- dependencies:
- chalk: 2.4.2
- coa: 2.0.2
- css-select: 2.1.0
- css-select-base-adapter: 0.1.1
- css-tree: 1.0.0-alpha.37
- csso: 4.2.0
- js-yaml: 3.14.1
- mkdirp: 0.5.5
- object.values: 1.1.5
- sax: 1.2.4
- stable: 0.1.8
- unquote: 1.1.1
- util.promisify: 1.0.1
- dev: false
-
/svgo/2.7.0:
resolution: {integrity: sha512-aDLsGkre4fTDCWvolyW+fs8ZJFABpzLXbtdK1y71CKnHzAnpDxKXPj2mNKj+pyOXUCzFHzuxRJ94XOFygOWV3w==}
engines: {node: '>=10.13.0'}
@@ -20551,10 +20288,6 @@ packages:
resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==}
dev: false
- /tryer/1.0.1:
- resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==}
- dev: false
-
/ts-essentials/2.0.12:
resolution: {integrity: sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==}
dev: false
@@ -21143,10 +20876,6 @@ packages:
engines: {node: '>= 0.8'}
dev: false
- /unquote/1.1.1:
- resolution: {integrity: sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=}
- dev: false
-
/unset-value/1.0.0:
resolution: {integrity: sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=}
engines: {node: '>=0.10.0'}
@@ -21312,15 +21041,6 @@ packages:
object.getownpropertydescriptors: 2.1.3
dev: false
- /util.promisify/1.0.1:
- resolution: {integrity: sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==}
- dependencies:
- define-properties: 1.1.3
- es-abstract: 1.19.1
- has-symbols: 1.0.2
- object.getownpropertydescriptors: 2.1.3
- dev: false
-
/utila/0.4.0:
resolution: {integrity: sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=}
dev: false