Skip to content

Commit

Permalink
fix(webpack): set isolatedConfig to true by default (nrwl#20281)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Nov 22, 2023
1 parent 0b4c2da commit a22c422
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/generated/packages/webpack/executors/webpack.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
"isolatedConfig": {
"type": "boolean",
"description": "Do not apply Nx webpack plugins automatically. Plugins need to be applied in the project's webpack.config.js file (e.g. withNx, withReact, etc.).",
"default": false
"default": true
},
"extractLicenses": {
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('app', () => {

expect(projects.get('my-app').root).toEqual('my-app');
expect(projects.get('my-app-e2e').root).toEqual('my-app-e2e');
});
}, 60_000);

it('should add vite types to tsconfigs', async () => {
await applicationGenerator(appTree, {
Expand Down Expand Up @@ -388,7 +388,6 @@ describe('app', () => {
scripts: [],
styles: ['my-app/src/styles.css'],
tsConfig: 'my-app/tsconfig.app.json',
isolatedConfig: true,
webpackConfig: 'my-app/webpack.config.js',
});
expect(targetConfig.build.configurations.production).toEqual({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ function createBuildTarget(options: NormalizedSchema): TargetConfiguration {
),
],
scripts: [],
isolatedConfig: true,
webpackConfig: joinPathFragments(
options.appProjectRoot,
'webpack.config.js'
Expand Down
7 changes: 4 additions & 3 deletions packages/web/src/generators/application/application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('app', () => {
expect(readProjectConfiguration(tree, 'my-app-e2e').root).toEqual(
'my-app-e2e'
);
}, 35000);
}, 60_000);

it('should update tags and implicit dependencies', async () => {
await applicationGenerator(tree, {
Expand All @@ -53,7 +53,7 @@ describe('app', () => {
implicitDependencies: ['my-app'],
},
});
});
}, 60_000);

it('should generate files', async () => {
await applicationGenerator(tree, {
Expand Down Expand Up @@ -225,7 +225,7 @@ describe('app', () => {
expect(readProjectConfiguration(tree, 'my-app-e2e').root).toEqual(
'my-dir/my-app-e2e'
);
}, 35000);
}, 60_000);

it('should update tags and implicit dependencies', async () => {
await applicationGenerator(tree, {
Expand Down Expand Up @@ -358,6 +358,7 @@ describe('app', () => {
expect(targets.build.executor).toEqual('@nx/webpack:webpack');
expect(targets.build.outputs).toEqual(['{options.outputPath}']);
expect(targets.build.options).toEqual({
target: 'web',
compiler: 'babel',
assets: ['my-app/src/favicon.ico', 'my-app/src/assets'],
index: 'my-app/src/index.html',
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async function setupBundler(tree: Tree, options: NormalizedSchema) {
typeof import('@nx/webpack')
>('@nx/webpack', nxVersion);
await configurationGenerator(tree, {
target: 'web',
project: options.projectName,
main,
tsConfig,
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack/src/executors/webpack/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
"isolatedConfig": {
"type": "boolean",
"description": "Do not apply Nx webpack plugins automatically. Plugins need to be applied in the project's webpack.config.js file (e.g. withNx, withReact, etc.).",
"default": false
"default": true
},
"extractLicenses": {
"type": "boolean",
Expand Down

0 comments on commit a22c422

Please sign in to comment.