Skip to content

Commit 3759b23

Browse files
authored
Merge branch 'vnext' into rivanova/button-group-samples
2 parents 64e4b2f + a12b088 commit 3759b23

1,434 files changed

Lines changed: 653713 additions & 120589 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

azure-pipelines/build-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ stages:
8383
command: custom
8484
workingDir: '$(Build.SourcesDirectory)\browser'
8585
verbose: ${{ parameters.isVerbose }}
86-
customCommand: 'install --legacy-peer-deps'
86+
customCommand: 'install'
8787
customEndpoint: 'public proget'
8888

8989
- task: PowerShell@2

browser/config-overrides.js

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
const path = require('path');
22
let pathsConfig = require("./tsconfig.paths.json");
33
const {alias, configPaths, expandResolveAlias, expandRulesInclude, expandPluginsScope} = require('react-app-rewire-alias')
4+
const resolve = require('resolve');
5+
const shouldUseSourceMap = false; // process.env.GENERATE_SOURCEMAP !== 'false';
6+
const ForkTsCheckerWebpackPlugin =
7+
process.env.TSC_COMPILE_ON_ERROR === 'true'
8+
? require('react-dev-utils/ForkTsCheckerWarningWebpackPlugin')
9+
: require('react-dev-utils/ForkTsCheckerWebpackPlugin');
410

511
//this works around the fact that alias doesn't support multiple paths
612
function aliasMultiple(aliasMap) {
@@ -26,6 +32,15 @@ function aliasMultiple(aliasMap) {
2632
/* eslint-disable @typescript-eslint/no-var-requires */
2733
module.exports = function override(config, env) {
2834
console.log("config-overrides.js started");
35+
console.log("env: " + env);
36+
const isEnvDevelopment = env === 'development';
37+
const isEnvProduction = env === 'production';
38+
39+
// Variable used for enabling profiling in Production
40+
// passed into alias object. Uses a flag if passed into the build command
41+
const isEnvProductionProfile =
42+
isEnvProduction && process.argv.includes('--profile');
43+
2944
const paths = require('./node_modules/react-scripts/config/paths');
3045
// console.log("config-overrides.js paths");
3146
console.log(paths);
@@ -166,7 +181,70 @@ module.exports = function override(config, env) {
166181
//let newConfig = alias(configPathsMultiple('./tsconfig.paths.json'))(config);
167182
//console.log(newConfig);
168183

184+
if (!config.resolve) {
185+
config.resolve = {};
186+
}
187+
config.resolve.mainFields = ["esm2015", "module", "main"];
188+
189+
let checkerInd = -1;
190+
for (var i = 0; i < config.plugins.length; i++) {
191+
if (config.plugins[i] instanceof ForkTsCheckerWebpackPlugin) {
192+
checkerInd = i;
193+
break;
194+
}
195+
}
196+
if (checkerInd >= 0) {
197+
let checker = new ForkTsCheckerWebpackPlugin({
198+
async: isEnvDevelopment,
199+
typescript: {
200+
memoryLimit: 10240,
201+
typescriptPath: resolve.sync('typescript', {
202+
basedir: paths.appNodeModules,
203+
}),
204+
configOverwrite: {
205+
compilerOptions: {
206+
sourceMap: isEnvProduction
207+
? shouldUseSourceMap
208+
: isEnvDevelopment,
209+
skipLibCheck: true,
210+
inlineSourceMap: false,
211+
declarationMap: false,
212+
noEmit: true,
213+
incremental: true,
214+
tsBuildInfoFile: paths.appTsBuildInfoFile,
215+
},
216+
},
217+
context: paths.appPath,
218+
diagnosticOptions: {
219+
syntactic: true,
220+
},
221+
mode: 'write-references',
222+
// profile: true,
223+
},
224+
issue: {
225+
// This one is specifically to match during CI tests,
226+
// as micromatch doesn't match
227+
// '../cra-template-typescript/template/src/App.tsx'
228+
// otherwise.
229+
include: [
230+
{ file: '../**/src/**/*.{ts,tsx}' },
231+
{ file: '**/src/**/*.{ts,tsx}' },
232+
],
233+
exclude: [
234+
{ file: '**/src/**/__tests__/**' },
235+
{ file: '**/src/**/?(*.){spec|test}.*' },
236+
{ file: '**/src/setupProxy.*' },
237+
{ file: '**/src/setupTests.*' },
238+
],
239+
},
240+
logger: {
241+
infrastructure: 'silent',
242+
},
243+
});
244+
config.plugins[checkerInd] = checker;
245+
}
246+
169247
let newConfig = aliasMultiple(tspaths)(config);
170248
console.log(newConfig);
171249
return newConfig;
172-
}
250+
}

0 commit comments

Comments
 (0)