@ozo/cra-rewired

1.0.7 • Public • Published

注意事项

以下功能需要单独安装对应的包才能使用。

  • 骨架屏 prerender: prerender-spa-plugin
  • 热更新: react-hot-loader / react-app-rewire-hot-loader
  • ice 按需加载:webpack-plugin-import
  • dropConsole:drop-console-webpack-plugin

yarn start/build 参数:

  • --prerender 启用骨架屏
  • --smp 启用打包速度分析
  • --debug 启用 vConsole

bug 记录

// customize-cra 1.0 及以前部分版本对于 eslint 的引入存在自定义不生效的 bug,通过 useEslintConfig 方法覆盖 CRA 默认的 eslint 规则

// 默认目录,./.eslintrc.js
useEslintConfig()
// 自定义目录
useEslintConfig(require('./.eslintrc.js'))

支持 antd-mobile 的 less 样式覆盖

// antd-mobile.js
module.export = {
    // antd-mobile的less变量
}

// config-overrides.js

const antdMobileTheme = require(getTheme(pkgJSON)["antd-mobile"]) || {};
module.exports = override(
    ...
    addLessLoader({
        lessOptions: {
            modifyVars: antdMobileTheme,
            javascriptEnabled: true,
        },
    }),
    ...
);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.7
    0
    • latest

Version History

Package Sidebar

Install

npm i @ozo/cra-rewired

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

44 kB

Total Files

37

Last publish

Collaborators

  • iniers