React create-react-app 构建时更改静态目录名称
React create-react-app Change name of static directory when building
我有一个 React 应用程序(使用 create-react-app
创建并使用 yarn
构建)。
当我构建应用程序 (yarn build
) 时,我希望 static
目录和其中对资源的所有引用不是 static
.
这个问题引用了我想做的事情:https://github.com/facebook/create-react-app/issues/1061
所以,问题是:如何更改 yarn 构建过程以将静态资源放在名为 static
以外的目录中?
您需要从 CRA 中弹出并手动配置 webpack,也许使用这个插件 https://github.com/webpack-contrib/copy-webpack-plugin
我有一个 React 应用程序(使用 create-react-app
创建并使用 yarn
构建)。
当我构建应用程序 (yarn build
) 时,我希望 static
目录和其中对资源的所有引用不是 static
.
这个问题引用了我想做的事情:https://github.com/facebook/create-react-app/issues/1061
所以,问题是:如何更改 yarn 构建过程以将静态资源放在名为 static
以外的目录中?
您需要从 CRA 中弹出并手动配置 webpack,也许使用这个插件 https://github.com/webpack-contrib/copy-webpack-plugin