diff --git a/config/mp/paths.js b/config/mp/paths.js index 54a4f79..495e766 100644 --- a/config/mp/paths.js +++ b/config/mp/paths.js @@ -47,6 +47,7 @@ module.exports = { appWebpackCache: resolveRoot('node_modules/.cache'), appTsBuildInfoFile: resolveRoot('node_modules/.cache/tsconfig.tsbuildinfo'), publicUrlOrPath: '/', + appOutSrc: resolveRoot('src'), }; diff --git a/config/web/paths.js b/config/web/paths.js index bf8dd9c..7ddaffc 100644 --- a/config/web/paths.js +++ b/config/web/paths.js @@ -71,6 +71,7 @@ module.exports = { appTsBuildInfoFile: resolveRoot('node_modules/.cache/tsconfig.tsbuildinfo'), swSrc: resolveModule(resolveApp, 'src/service-worker'), publicUrlOrPath, + appOutSrc: resolveRoot('src'), }; diff --git a/config/web/webpack.config.js b/config/web/webpack.config.js index 8217da6..93aa634 100644 --- a/config/web/webpack.config.js +++ b/config/web/webpack.config.js @@ -335,17 +335,23 @@ module.exports = function (webpackEnv) { // To fix this, we prevent you from importing files out of src/ -- if you'd like to, // please link the files into your node_modules/ and let module-resolution kick in. // Make sure your source files are compiled, as they will not be processed in any way. - new ModuleScopePlugin(paths.appSrc, [ - paths.appPackageJson, - reactRefreshRuntimeEntry, - reactRefreshWebpackPluginRuntimeEntry, - babelRuntimeEntry, - babelRuntimeEntryHelpers, - babelRuntimeRegenerator, - ]), + // new ModuleScopePlugin(paths.appSrc, [ + // paths.appPackageJson, + // reactRefreshRuntimeEntry, + // reactRefreshWebpackPluginRuntimeEntry, + // babelRuntimeEntry, + // babelRuntimeEntryHelpers, + // babelRuntimeRegenerator, + // ]), ], }, module: { + parser: { + javascript: { + reexportExportsPresence: false, + // exportsPresence: 'error', + }, + }, strictExportPresence: true, rules: [ // Handle node_modules packages that contain sourcemaps @@ -414,7 +420,15 @@ module.exports = function (webpackEnv) { // The preset includes JSX, Flow, TypeScript, and some ESnext features. { test: /\.(js|mjs|jsx|ts|tsx)$/, - include: paths.appSrc, + include: [ + paths.appOutSrc, + paths.appSrc, + /oak-domain/, + /oak-external-sdk/, + /oak-frontend-base/, + /oak-general-business/, + /oak-memory-tree-store/, + ], loader: require.resolve('babel-loader'), options: { customize: require.resolve( @@ -693,53 +707,53 @@ module.exports = function (webpackEnv) { maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, }), // TypeScript type checking - useTypeScript && - new ForkTsCheckerWebpackPlugin({ - async: isEnvDevelopment, - typescript: { - typescriptPath: resolve.sync('typescript', { - basedir: paths.appNodeModules, - }), - configOverwrite: { - compilerOptions: { - sourceMap: isEnvProduction - ? shouldUseSourceMap - : isEnvDevelopment, - skipLibCheck: true, - inlineSourceMap: false, - declarationMap: false, - noEmit: true, - incremental: true, - tsBuildInfoFile: paths.appTsBuildInfoFile, - }, - }, - context: paths.appPath, - diagnosticOptions: { - syntactic: true, - }, - mode: 'write-references', - // profile: true, - }, - issue: { - // This one is specifically to match during CI tests, - // as micromatch doesn't match - // '../cra-template-typescript/template/src/App.tsx' - // otherwise. - include: [ - { file: '../**/src/**/*.{ts,tsx}' }, - { file: '**/src/**/*.{ts,tsx}' }, - ], - exclude: [ - { file: '**/src/**/__tests__/**' }, - { file: '**/src/**/?(*.){spec|test}.*' }, - { file: '**/src/setupProxy.*' }, - { file: '**/src/setupTests.*' }, - ], - }, - logger: { - infrastructure: 'silent', - }, - }), + // useTypeScript && + // new ForkTsCheckerWebpackPlugin({ + // async: isEnvDevelopment, + // typescript: { + // typescriptPath: resolve.sync('typescript', { + // basedir: paths.appNodeModules, + // }), + // configOverwrite: { + // compilerOptions: { + // sourceMap: isEnvProduction + // ? shouldUseSourceMap + // : isEnvDevelopment, + // skipLibCheck: true, + // inlineSourceMap: false, + // declarationMap: false, + // noEmit: true, + // incremental: true, + // tsBuildInfoFile: paths.appTsBuildInfoFile, + // }, + // }, + // context: paths.appPath, + // diagnosticOptions: { + // syntactic: true, + // }, + // mode: 'write-references', + // // profile: true, + // }, + // issue: { + // // This one is specifically to match during CI tests, + // // as micromatch doesn't match + // // '../cra-template-typescript/template/src/App.tsx' + // // otherwise. + // include: [ + // { file: '../**/src/**/*.{ts,tsx}' }, + // { file: '**/src/**/*.{ts,tsx}' }, + // ], + // exclude: [ + // { file: '**/src/**/__tests__/**' }, + // { file: '**/src/**/?(*.){spec|test}.*' }, + // { file: '**/src/setupProxy.*' }, + // { file: '**/src/setupTests.*' }, + // ], + // }, + // logger: { + // infrastructure: 'silent', + // }, + // }), !disableESLintPlugin && new ESLintPlugin({ // Plugin options