- In file '/angular/demo{#}/src/assets/sass/style.angular.scss' comment the next rows [8, 9]:
// @import "./core/vendors/plugins/prismjs";
// @import "./core/vendors/plugins/formvalidation";
-
Add 'rtl.config.js' file into project (path should be: '/angular/demo{#}/rtl.config.js').
-
In file 'package.json' add the next 'devDependencies':
"@types/sass-loader": "8.0.3",
"css-loader": "6.7.1",
"del": "6.0.0",
"mini-css-extract-plugin": "2.6.1",
"sass-loader": "13.0.2",
"webpack": "5.74.0",
"webpack-cli": "4.10.0"
- In file 'package.json' add the next scripts command:
"rtl": "webpack --config=rtl.config.js"
-
Find and replace next attributes in the project:
data-kt-menu-placement="bottom-start" => data-kt-menu-placement="bottom-end"
data-kt-menu-placement="right-start" => data-kt-menu-placement="left-start"
-
Run:
yarn install
- In file '/angular/demo{#}/src/index.html' change 'body' tag:
<body root id="kt_body" class="mat-typography" direction="rtl" dir="rtl" style="direction: rtl">
- Run:
yarn run rtl
- In file '/angular/demo{#}/src/styles.scss' file change RTL import to the LTL one (row 2):
/* You can add global styles to this file, and also import other style files */
// @import "./assets/sass/style.scss";
// Replace above style with this css file to enable RTL styles
// @import './assets/sass/plugins.scss';
@import "./assets/css/style.rtl.css";
@import "./assets/sass/style.angular.scss";
- Run:
ng serve
yarn run rtl
yarn run v1.22.19
$ webpack --config webpack-rtl.config.js
[webpack-cli] Failed to load '/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/webpack-rtl.config.js' config
[webpack-cli] Error: Cannot find module 'del'
Require stack:
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/webpack-rtl.config.js:10:13)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/webpack-rtl.config.js',
'/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/node_modules/webpack-cli/lib/webpack-cli.js',
'/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/node_modules/webpack-cli/lib/bootstrap.js',
'/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/node_modules/webpack-cli/bin/cli.js',
'/Users/ahmedalobed/Documents/script_projects/metronic-edunet-master/node_modules/webpack/bin/webpack.js'
]
}
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.