@openedx/frontend-build 15.0.0-alpha.26 → 15.0.0-alpha.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,11 @@ module.exports = {
37
37
  'import/no-import-module-export': 'off',
38
38
  'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
39
39
  },
40
+ settings: {
41
+ 'import/resolver': {
42
+ typescript: {},
43
+ },
44
+ },
40
45
  globals: {
41
46
  newrelic: false,
42
47
  PARAGON_THEME: false,
@@ -1,5 +1,7 @@
1
+ const fs = require('fs');
1
2
  const path = require('path');
2
3
  const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');
4
+ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
3
5
 
4
6
  const ParagonWebpackPlugin = require('../lib/plugins/paragon-webpack-plugin/ParagonWebpackPlugin');
5
7
  const {
@@ -11,6 +13,14 @@ const {
11
13
  const paragonThemeCss = getParagonThemeCss(process.cwd());
12
14
  const brandThemeCss = getParagonThemeCss(process.cwd(), { isBrandOverride: true });
13
15
 
16
+ const tsconfigPath = path.resolve(process.cwd(), 'tsconfig.json');
17
+ const resolvePlugins = [];
18
+
19
+ // Conditionally add TsconfigPathsPlugin if tsconfig.json exists
20
+ if (fs.existsSync(tsconfigPath)) {
21
+ resolvePlugins.push(new TsconfigPathsPlugin({ configFile: tsconfigPath }));
22
+ }
23
+
14
24
  module.exports = {
15
25
  entry: {
16
26
  app: path.resolve(process.cwd(), './src/index'),
@@ -45,6 +55,7 @@ module.exports = {
45
55
  'env.config': false,
46
56
  },
47
57
  extensions: ['.js', '.jsx', '.ts', '.tsx'],
58
+ plugins: resolvePlugins,
48
59
  },
49
60
  optimization: {
50
61
  splitChunks: {
@@ -59,7 +70,6 @@ module.exports = {
59
70
  // RemoveEmptyScriptsPlugin get rid of empty scripts generated by webpack when using mini-css-extract-plugin
60
71
  // This helps to clean up the final bundle application
61
72
  // See: https://www.npmjs.com/package/webpack-remove-empty-scripts#usage-with-mini-css-extract-plugin
62
-
63
73
  new RemoveEmptyScriptsPlugin(),
64
74
  new ParagonWebpackPlugin(),
65
75
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/frontend-build",
3
- "version": "15.0.0-alpha.26",
3
+ "version": "15.0.0-alpha.27",
4
4
  "description": "Build tools, setup and config for frontend apps",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,9 @@
10
10
  "fedx-scripts": "./bin/fedx-scripts.js"
11
11
  },
12
12
  "scripts": {
13
- "lint": "eslint . --no-eslintrc -c .eslintrc.js",
13
+ "lint": "npm run lint:root && npm run lint:example",
14
+ "lint:root": "eslint . --no-eslintrc -c .eslintrc.js",
15
+ "lint:example": "cd example && npm run lint",
14
16
  "test": "bash ./smoke-test.sh"
15
17
  },
16
18
  "files": [
@@ -64,6 +66,7 @@
64
66
  "eslint": "8.44.0",
65
67
  "eslint-config-airbnb": "19.0.4",
66
68
  "eslint-config-airbnb-typescript": "^17.0.0",
69
+ "eslint-import-resolver-typescript": "^4.2.1",
67
70
  "eslint-plugin-formatjs": "^4.12.2",
68
71
  "eslint-plugin-import": "2.31.0",
69
72
  "eslint-plugin-jsx-a11y": "6.7.1",
@@ -91,6 +94,7 @@
91
94
  "source-map-loader": "4.0.2",
92
95
  "style-loader": "3.3.4",
93
96
  "ts-jest": "29.1.4",
97
+ "tsconfig-paths-webpack-plugin": "^4.2.0",
94
98
  "typescript": "4.9.5",
95
99
  "url-loader": "4.1.1",
96
100
  "webpack": "^5.97.1",