diff --git a/package.json b/package.json index a6b35b38..d0ad763c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openedx/frontend-base", - "version": "1.0.0-alpha.7", + "version": "1.0.0-alpha.8", "description": "Build tools, setup and config for frontend apps", "publishConfig": { "access": "public" diff --git a/runtime/jest.config.js b/runtime/jest.config.js index 27050a5f..6051969f 100644 --- a/runtime/jest.config.js +++ b/runtime/jest.config.js @@ -7,6 +7,7 @@ module.exports = { '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/site.config.test.tsx', + '^@src/(.*)$': '/src/$1', }, testEnvironment: 'jsdom', testEnvironmentOptions: { diff --git a/shell/jest.config.js b/shell/jest.config.js index 706927c3..670a6840 100644 --- a/shell/jest.config.js +++ b/shell/jest.config.js @@ -7,6 +7,7 @@ module.exports = { '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '/__mocks__/file.js', '\\.(css|scss)$': require.resolve('identity-obj-proxy'), 'site.config': '/site.config.test.tsx', + '^@src/(.*)$': '/src/$1', }, testEnvironment: 'jsdom', testEnvironmentOptions: { diff --git a/tools/jest/jest.config.js b/tools/jest/jest.config.js index f601ce3e..e79c812d 100644 --- a/tools/jest/jest.config.js +++ b/tools/jest/jest.config.js @@ -9,6 +9,7 @@ module.exports = { moduleNameMapper: { '\\.(css|scss)$': require.resolve('identity-obj-proxy'), 'site.config': path.resolve(process.cwd(), './site.config.test.tsx'), + '^@src/(.*)$': '/src/$1', }, collectCoverageFrom: [ 'src/**/*.{js,jsx,ts,tsx}', diff --git a/tools/tsconfig.json b/tools/tsconfig.json index f1370cc1..8cc7f694 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -6,6 +6,9 @@ "noEmit": false, "allowJs": true, "resolveJsonModule": true, + "paths": { + "@src/*": ["./src/*"] + } }, "include": [ "babel/**/*", diff --git a/tools/webpack/webpack.config.build.ts b/tools/webpack/webpack.config.build.ts index ca640e41..101385a0 100644 --- a/tools/webpack/webpack.config.build.ts +++ b/tools/webpack/webpack.config.build.ts @@ -36,6 +36,7 @@ const config: Configuration = { alias: { ...aliases, 'site.config': resolvedSiteConfigPath, + '@src': path.resolve(process.cwd(), 'src'), }, extensions: ['.js', '.jsx', '.ts', '.tsx'], }, diff --git a/tools/webpack/webpack.config.dev.shell.ts b/tools/webpack/webpack.config.dev.shell.ts index 19ea3054..244731c7 100644 --- a/tools/webpack/webpack.config.dev.shell.ts +++ b/tools/webpack/webpack.config.dev.shell.ts @@ -34,6 +34,7 @@ const config: Configuration = { alias: { ...aliases, 'site.config': resolvedSiteConfigPath, + '@src': path.resolve(process.cwd(), 'src'), }, extensions: ['.js', '.jsx', '.ts', '.tsx'], }, diff --git a/tools/webpack/webpack.config.dev.ts b/tools/webpack/webpack.config.dev.ts index 90fe5ee9..cb9d2ae1 100644 --- a/tools/webpack/webpack.config.dev.ts +++ b/tools/webpack/webpack.config.dev.ts @@ -33,6 +33,7 @@ const config: Configuration = { alias: { ...aliases, 'site.config': resolvedSiteConfigPath, + '@src': path.resolve(process.cwd(), 'src'), }, extensions: ['.js', '.jsx', '.ts', '.tsx'], }, diff --git a/tsconfig.json b/tsconfig.json index 24eab210..e0f9f58b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,9 @@ "compilerOptions": { "rootDir": ".", "outDir": "dist", + "paths": { + "@src/*": ["./src/*"] + } }, "include": [ "runtime/**/*",