@oroinc/oro-webpack-config-builder 4.2.1-dev1 → 4.2.1-dev5

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.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  An integration of OroPlatform based applications with the Webpack.
4
4
 
5
- For more details see [the documentation](https://doc.oroinc.com/backend/bundles/platform/AssetBundle/).
5
+ For more details see [the documentation](https://doc.oroinc.com/bundles/platform/AssetBundle/).
@@ -4,7 +4,7 @@ const ModulesConfigLoader = require('./modules-config-loader');
4
4
 
5
5
  class LayoutModulesConfigLoader extends ModulesConfigLoader {
6
6
  /**
7
- * {@inheritdoc}
7
+ * @inheritdoc
8
8
  */
9
9
  loadConfig(theme, filePath) {
10
10
  let themeConfig = super.loadConfig(theme, path.join('/Resources/views/layouts/', theme, filePath));
@@ -3,6 +3,9 @@ const fs = require('fs');
3
3
  const merge = require('deepmerge');
4
4
  const yaml = require('js-yaml');
5
5
 
6
+ // merge only unique items
7
+ const arrayMerge = (target, source) => target.concat(source.filter(item => !target.includes(item)));
8
+
6
9
  class ModulesConfigLoader {
7
10
  /**
8
11
  * @returns {Array}
@@ -43,17 +46,15 @@ class ModulesConfigLoader {
43
46
  if (!fs.existsSync(source)) return;
44
47
 
45
48
  fs.readdirSync(source).forEach(name => {
46
- const theme = path.resolve(source, name);
47
- if (!fs.lstatSync(theme).isDirectory()) {
49
+ const themePath = path.resolve(source, name);
50
+ if (!fs.lstatSync(themePath).isDirectory()) {
48
51
  return;
49
52
  }
50
- const themeFile = path.resolve(theme, themeInfoFileName);
53
+ const themeFile = path.resolve(themePath, themeInfoFileName);
51
54
  if (!fs.existsSync(themeFile)) return;
52
55
 
53
- if (!(name in themes)) {
54
- themes[name] = null;
55
- }
56
- themes[name] = yaml.safeLoad(fs.readFileSync(themeFile, 'utf8'));
56
+ const theme = yaml.load(fs.readFileSync(themeFile, 'utf8'));
57
+ themes[name] = merge(themes[name] || {}, theme, {arrayMerge});
57
58
  });
58
59
  });
59
60
 
@@ -71,7 +72,7 @@ class ModulesConfigLoader {
71
72
  const absolutePath = bundle + filePath;
72
73
  if (!fs.existsSync(absolutePath)) return;
73
74
 
74
- const doc = yaml.safeLoad(fs.readFileSync(absolutePath, 'utf8'));
75
+ const doc = yaml.load(fs.readFileSync(absolutePath, 'utf8'));
75
76
  configs = merge(configs, doc);
76
77
  });
77
78
  return configs;
@@ -19,7 +19,7 @@ const ThemeConfigFactory = require('./theme-config-factory');
19
19
  const path = require('path');
20
20
  const prepareModulesMap = require('./plugin/map/prepare-modules-map');
21
21
  const resolve = require('enhanced-resolve');
22
- const webpackMerge = require('webpack-merge');
22
+ const {merge: webpackMerge} = require('webpack-merge');
23
23
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
24
24
  const WebpackRTLPlugin = require('webpack-rtl-plugin');
25
25
 
@@ -146,7 +146,7 @@ class ConfigBuilder {
146
146
  if (this._defaultLayoutThemes) {
147
147
  themes = [...themes, ...this._defaultLayoutThemes];
148
148
  } else {
149
- themes = [...themes, ...Object.keys(this._layoutModulesConfigLoader.themes)];
149
+ themes = [...themes, ...this._appConfig['themes']];
150
150
  }
151
151
  } else if (this._layoutThemes.indexOf(selectedTheme) !== -1) {
152
152
  // build single layout theme
@@ -387,7 +387,9 @@ class ConfigBuilder {
387
387
  const plugins = [];
388
388
  if (rtlSupport && !env.skipCSS && !env.skipRTL) {
389
389
  plugins.push(new WebpackRTLPlugin({
390
- filename: '[name].rtl.css'
390
+ filename: '[name].rtl.css',
391
+ // RTL all chunks, except those that already support RTL
392
+ test: '(?<!(-rtl-ready))\\.css'
391
393
  }));
392
394
  }
393
395
 
package/package.json CHANGED
@@ -1,46 +1,45 @@
1
1
  {
2
2
  "name": "@oroinc/oro-webpack-config-builder",
3
- "version": "4.2.1-dev1",
3
+ "version": "4.2.1-dev5",
4
4
  "author": "Oro, Inc (https://www.oroinc.com)",
5
5
  "license": "MIT",
6
6
  "description": "An integration of OroPlatform based applications with the Webpack.",
7
7
  "main": "oro-webpack-config.js",
8
8
  "dependencies": {
9
- "@babel/core": "^7.10.4",
10
- "@babel/plugin-transform-runtime": "^7.10.4",
11
- "@babel/preset-env": "^7.10.4",
12
- "autoprefixer": "9.6.1",
13
- "babel-loader": "^8.1.0",
9
+ "@babel/core": "^7.16.0",
10
+ "@babel/plugin-transform-runtime": "^7.16.4",
11
+ "@babel/preset-env": "^7.16.4",
12
+ "autoprefixer": "^9.8.8",
13
+ "babel-loader": "^8.2.3",
14
14
  "css-loader": "^3.6.0",
15
- "deepmerge": "3.3.0",
15
+ "deepmerge": "4.2.2",
16
16
  "exports-loader": "^0.7.0",
17
17
  "expose-loader": "^0.7.5",
18
18
  "extract-loader": "3.1.0",
19
19
  "file-loader": "^4.3.0",
20
20
  "font-awesome": "4.7.0",
21
21
  "happypack": "^5.0.1",
22
- "html-webpack-plugin": "^3.2.0",
23
22
  "imports-loader": "^0.8.0",
24
23
  "inject-loader": "^4.0.1",
25
- "js-yaml": "3.13.1",
24
+ "js-yaml": "4.1.0",
26
25
  "mini-css-extract-plugin": "0.7.0",
27
26
  "minimist": "^1.2.3",
28
- "node-sass": "^4.14.1",
27
+ "node-sass": "^6.0.1",
29
28
  "optimize-css-assets-webpack-plugin": "5.0.3",
30
29
  "path": "0.12.7",
31
30
  "postcss-loader": "3.0.0",
32
- "printf": "^0.6.0",
31
+ "printf": "^0.6.1",
33
32
  "sass-loader": "7.1.0",
34
33
  "style-loader": "^0.23.1",
35
34
  "terser": "4.1.2",
36
35
  "text-loader": "0.0.1",
37
- "underscore": "^1.10.2",
36
+ "underscore": "1.13.*",
38
37
  "url-loader": "2.0.1",
39
- "webpack": "^4.43.0",
40
- "webpack-bundle-analyzer": "^3.8.0",
38
+ "webpack": "^4.46.0",
39
+ "webpack-bundle-analyzer": "^4.5.0",
41
40
  "webpack-cli": "^3.3.12",
42
- "webpack-dev-server": "^3.11.0",
43
- "webpack-merge": "4.2.1",
41
+ "webpack-dev-server": "^4.5.0",
42
+ "webpack-merge": "5.8.0",
44
43
  "webpack-rtl-plugin": "^2.0.0",
45
44
  "wildcard": "^2.0.0"
46
45
  }