fix(v2): babel/env should pick correct browserslist config in dev (#1948)

* fix(v2): babel/env should pick correct browserslist config in dev

* nits
This commit is contained in:
Endi 2019-11-08 13:15:02 +07:00 committed by Yangshun Tay
parent fc4928f7a6
commit a54a1dd186
3 changed files with 4 additions and 0 deletions

View file

@ -2,6 +2,7 @@
## Unreleased
- Fix babel/env not picking the correct browserslist configuration during development. When running `docusaurus start`, `process.env.NODE_ENV` is now consistently set to `development`.
- Ensure routes config generation to be more consistent in ordering. Nested routes should be placed last in routes.js. This will allow user to create `src/pages/docs.js` to create custom docs page for `/docs` or even `src/pages/docs/super.js` to create page for `/docs/super/`;
- Fix watcher does not trigger reload on windows.
- Add feed for blog posts.

View file

@ -48,6 +48,7 @@ export async function build(
siteDir: string,
cliOptions: Partial<BuildCLIOptions> = {},
): Promise<void> {
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
console.log(chalk.blue('Creating an optimized production build...'));

View file

@ -40,6 +40,8 @@ export async function start(
siteDir: string,
cliOptions: Partial<StartCLIOptions> = {},
): Promise<void> {
process.env.NODE_ENV = 'development';
process.env.BABEL_ENV = 'development';
console.log(chalk.blue('Starting the development server...'));
// Process all related files as a prop.