0.3.4 • Published 2 years ago

@vbait/react-scripts v0.3.4

Weekly downloads
113
License
MIT
Repository
github
Last release
2 years ago

react-scripts

This package includes scripts and configuration used by Create React App. Please refer to its documentation:

Extra ENV Variables

  • USE_CONTENTHASH: boolean - true by default
  • USE_CHUNK_CONTENTHASH: boolean - true by default
  • USE_MANIFEST: boolean - true by default
  • CHUNK_FILENAME: string - '.chunk' by default
  • ASSETS_PATH: string - 'static/' by default
  • GENERATE_HTML: boolean - true by default

If it isn't enough then you can extend your webpack config with file <root>/webpack.extend.js or <root>/webpack.server.extend.js

How to use it:

// webpack.extend.js
module.exports = (config, options) => {
  // change or create new config here
  return config;
};
// webpack.server.extend.js
module.exports = (serverConfig, options) => {
  // change or create new config here
  return config;
};

Options:

const options = {
  webpack,
  isEnvDevelopment,
  isEnvProduction,
  useTypeScript,
  useTailwind,
  hasJsxRuntime,
  assetsPath,
  paths,
  // extra
  chunkFilename,
  imageInlineSizeLimit,
  shouldInlineRuntimeChunk,
  shouldUseContentHash,
  shouldUseChunkContentHash,
  shouldUseManifest,
  shouldGenerateHtml,
  shouldUseReactRefresh,
  // plugins
  plugins: {
    MiniCssExtractPlugin,
    ESLintPlugin,
    HtmlWebpackPlugin,
  },
};

Options for webpack.sever.extend:

const options = {
  config, // webpack config
  paths,
};

How to use

npx create-react-app my-app --scripts-version @vbait/react-scripts --template cra-template-ab-typescript