Skip to content

Commit

Permalink
feat: add option useBabelConfig in file config to override project co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
swashata committed May 26, 2021
1 parent bfebee6 commit 32954a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/scripts/src/config/CreateWebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,18 @@ export class CreateWebpackConfig {
appName,
errorOverlay,
externals,
useBabelConfig,
jsBabelOverride,
jsBabelPresetOptions,
tsBabelOverride,
tsBabelPresetOptions,
useReactJsxRuntime,
disableWordPressExternals,
} = this.projectConfig;
// get useBabelConfig from project, but override from file
let useBabelConfig = this.projectConfig.useBabelConfig;
if (file.useBabelConfig !== undefined) {
useBabelConfig = file.useBabelConfig;
}
const { host, port } = this.serverConfig;
const helper: WebpackConfigHelper = new WebpackConfigHelper(
file,
Expand Down
1 change: 1 addition & 0 deletions packages/scripts/src/config/project.config.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface FileConfig {
isDev: boolean
) => webpack.Configuration);
optimizeForGutenberg?: boolean;
useBabelConfig?: boolean;
}

export type webpackOptionsOverrideFunction = (
Expand Down
14 changes: 14 additions & 0 deletions site/docs/guides/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Changelog
order: 50
shortTitle: Changelog
---

## VERSION 6.3.0

- **NEW** Option `useBabelConfig` in file config to override project-wide configuration for a particular entry.
- **NEW** Option `compileNodeModules` in project config to handle how `node_modules` are compiled during production and development.

---

For previous changelogs, kindly visit our [GitHub Repo](https://github.com/swashata/wp-webpack-script/blob/master/CHANGELOG.md).

0 comments on commit 32954a6

Please sign in to comment.