@oroinc/oro-webpack-config-builder 5.1.0-alpha9 → 5.1.0-dev0010

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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/error-handler.js +95 -0
  3. package/loader/config-loader.js +1 -2
  4. package/loader/inject-loader/LICENSE.md +21 -0
  5. package/loader/inject-loader/README.md +54 -0
  6. package/loader/inject-loader/index.js +10 -0
  7. package/loader/inject-loader/injectify.js +66 -0
  8. package/loader/inject-loader/package.json +55 -0
  9. package/loader/inject-loader/wrapper_template.js +32 -0
  10. package/modules-config/layout-modules-config-loader.js +89 -2
  11. package/modules-config/modules-config-loader.js +83 -19
  12. package/oro-webpack-config.js +420 -299
  13. package/package.json +39 -38
  14. package/plugin/logs/after-webpack-logs-plugin.js +25 -0
  15. package/style/admin-style-loader.js +4 -3
  16. package/style/layout-style-loader.js +3 -3
  17. package/style/style-loader.js +52 -7
  18. package/svg-sprite/index.js +135 -0
  19. package/svg-sprite/svg-sprite-config.js +5 -0
  20. package/svg-sprite/svgo-config.js +32 -0
  21. package/theme-config-factory.js +45 -6
  22. package/utils.js +30 -0
  23. package/validation/assets-validator.js +104 -0
  24. package/validation/errors/assets-input-file-error.js +24 -0
  25. package/validation/errors/assets-schema-error.js +40 -0
  26. package/validation/errors/base-error.js +37 -0
  27. package/validation/errors/jsmodules-extra-modules-error.js +22 -0
  28. package/validation/errors/jsmodules-schema-error.js +40 -0
  29. package/validation/errors/styles-error.js +24 -0
  30. package/validation/errors/svg-icons-schema-error.js +36 -0
  31. package/validation/index.js +41 -0
  32. package/validation/jsmodules-validator.js +55 -0
  33. package/validation/schema-validator.js +62 -0
  34. package/validation/schemas/assets-schema-full.js +22 -0
  35. package/validation/schemas/assets-schema.js +32 -0
  36. package/validation/schemas/jsmodules-schema-full.js +11 -0
  37. package/validation/schemas/jsmodules-schema.js +76 -0
  38. package/validation/schemas/svg-icons-schema-full.js +18 -0
  39. package/validation/schemas/svg-icons-schema.js +17 -0
  40. package/validation/svg-icons-validator.js +53 -0
  41. package/writer/configs-file-writer.js +1 -1
  42. package/writer/dynamic-imports-file-writer.js +3 -3
  43. package/writer/scss-entry-point-file-writer.js +1 -1
@@ -0,0 +1,24 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class AssetsInputFileError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Invalid styles config: input file does not exist /scss/test.scss
7
+ * at /config/assets.yml
8
+ * Please, find more information in the documentation https://doc.oroinc.com/...
9
+ *
10
+ * @param {string} notExistFile
11
+ * @param {string} path
12
+ */
13
+ constructor(notExistFile, path) {
14
+ const msg = `input file does not exist: ${notExistFile}\nat ${path}:1`;
15
+
16
+ super(msg);
17
+
18
+ this.name = 'Invalid styles config';
19
+ this.docLink =
20
+ 'https://doc.oroinc.com/backend/bundles/platform/AssetBundle/#load-scss-or-css-files-from-the-bundle';
21
+ }
22
+ }
23
+
24
+ module.exports = AssetsInputFileError;
@@ -0,0 +1,40 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class AssetsSchemaError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Invalid styles config: the "assets.yml" in the "default" theme file does not match the API schema.
7
+ * styles.inputs[0] should be: string | object
8
+ * at /config/assets.yml
9
+ * Please, find more information in the documentation https://doc.oroinc.com/...
10
+ *
11
+ * @example
12
+ * Invalid styles config: the "assets.yml" file the "default" theme does not match the API schema.
13
+ * styles misses the property 'output'.
14
+ * List of processed files for the "default" theme:
15
+ * /default/config/assets.yml
16
+ * /default/config/assets.yml
17
+ * Please, find more information in the documentation https://doc.oroinc.com/...
18
+ *
19
+ * @param {string} reason
20
+ * @param {Array} files
21
+ * @param {string} theme
22
+ */
23
+ constructor(reason, files, theme) {
24
+ let msg = `the "assets.yml" file in the "${theme}" theme does not match the API schema.\n${reason}`;
25
+
26
+ const filesListMsg = BaseError.generateFilesListMsg(files, theme);
27
+
28
+ if (filesListMsg.length) {
29
+ msg = `${msg}\n${filesListMsg}`;
30
+ }
31
+
32
+ super(msg);
33
+
34
+ this.name = 'Invalid styles config';
35
+ this.docLink =
36
+ 'https://doc.oroinc.com/backend/bundles/platform/AssetBundle/#load-scss-or-css-files-from-the-bundle';
37
+ }
38
+ }
39
+
40
+ module.exports = AssetsSchemaError;
@@ -0,0 +1,37 @@
1
+ const {isVerboseMode} = require('../../utils');
2
+
3
+ class BaseError extends Error {
4
+ /**
5
+ * Prepares documentation phrase
6
+ * @returns {string}
7
+ */
8
+ get extra() {
9
+ return this.docLink ? `Please, find more information in the documentation ${this.docLink}` : '';
10
+ }
11
+
12
+ /**
13
+ * Creates an instance of BaseError
14
+ * @param {string} message error message
15
+ */
16
+ constructor(message) {
17
+ super(message);
18
+ }
19
+
20
+ /**
21
+ * Creates a part of message about processed files
22
+ * @param {Array} files
23
+ * @param {string} theme
24
+ * @returns {string}
25
+ */
26
+ static generateFilesListMsg(files, theme) {
27
+ if (files.length === 1) {
28
+ return `at ${files[0]}:1`;
29
+ } else if (isVerboseMode()) {
30
+ return `List of processed files for the "${theme}" theme:\n ${files.join('\n ')}`;
31
+ }
32
+
33
+ return '';
34
+ }
35
+ }
36
+
37
+ module.exports = BaseError;
@@ -0,0 +1,22 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class JsmodulesExtraModulesError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Failed assembly JS: sections ["shim"] are not allowed in extra js build definition.
7
+ * Please, find more information in the documentation https://doc.oroinc.com/...
8
+ *
9
+ * @param {Array} parts
10
+ */
11
+ constructor(parts) {
12
+ const msg = `sections ["${parts.join('", "')}"] are not allowed in extra js build definition.`;
13
+
14
+ super(msg);
15
+
16
+ this.name = 'Failed assembly JS';
17
+ this.docLink =
18
+ 'https://doc.oroinc.com/master/frontend/storefront/how-to/how-to-create-extra-js-build-for-landing-page';
19
+ }
20
+ }
21
+
22
+ module.exports = JsmodulesExtraModulesError;
@@ -0,0 +1,40 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class JSModulesSchemaError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Invalid JS config: the "jsmodules.yml" files in the "default" theme do not match the API schema.
7
+ * has an unknown property 'rest'.
8
+ * at default/config/jsmodules.yml
9
+ * Please, find more information in the documentation https://doc.oroinc.com/...
10
+ *
11
+ * @example
12
+ * Invalid JS config: the "jsmodules.yml" files in the "default" theme do not match the API schema.
13
+ * misses the property 'entry'.
14
+ * List of processed files for the "default" theme:
15
+ * /default/config/jsmodules.yml
16
+ * /default/config/jsmodules.yml
17
+ * Please, find more information in the documentation https://doc.oroinc.com/...
18
+ *
19
+ * @param {string} reason
20
+ * @param {Array} files
21
+ * @param {string} theme
22
+ */
23
+ constructor(reason, files, theme) {
24
+ let msg = `the "jsmodules.yml" files in the "${theme}" theme do not match the API schema.\n${reason}`;
25
+
26
+ const filesListMsg = BaseError.generateFilesListMsg(files, theme);
27
+
28
+ if (filesListMsg.length) {
29
+ msg = `${msg}\n${filesListMsg}`;
30
+ }
31
+
32
+ super(msg);
33
+
34
+ this.name = 'Invalid JS config';
35
+ this.docLink =
36
+ 'https://doc.oroinc.com/backend/bundles/platform/AssetBundle/#create-jsmodules-yml-configuration';
37
+ }
38
+ }
39
+
40
+ module.exports = JSModulesSchemaError;
@@ -0,0 +1,24 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class StylesError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Failed assembly styles: the "output" for "styles" entry point in "default" theme is not defined.
7
+ * Please, find more information in the documentation https://doc.oroinc.com/...
8
+ *
9
+ * @param {string} key
10
+ * @param {string} group
11
+ * @param {string} theme
12
+ */
13
+ constructor(key, group, theme) {
14
+ const msg = `the "${key}" for "${group}" entry point in "${theme}" theme is not defined.`;
15
+
16
+ super(msg);
17
+
18
+ this.name = 'Failed assembly styles';
19
+ this.docLink =
20
+ 'https://doc.oroinc.com/backend/bundles/platform/AssetBundle/#load-scss-or-css-files-from-the-bundle';
21
+ }
22
+ }
23
+
24
+ module.exports = StylesError;
@@ -0,0 +1,36 @@
1
+ const BaseError = require('./base-error');
2
+
3
+ class SvgIconsSchemaError extends BaseError {
4
+ /**
5
+ * @example
6
+ * Invalid SVG config: the "svg-icons.yml" files in the "default" theme do not match the API schema.
7
+ * has an unknown property 'rest'.
8
+ * at default/config/svg-icons.yml
9
+ *
10
+ * @example
11
+ * Invalid SVG config: the "svg-icons.yml" files in the "default" theme do not match the API schema.
12
+ * misses the property 'exclude'.
13
+ * List of processed files for the "default" theme:
14
+ * /default/config/svg-icons.yml
15
+ * /default/config/svg-icons.yml
16
+ *
17
+ * @param {string} reason
18
+ * @param {Array} files
19
+ * @param {string} theme
20
+ */
21
+ constructor(reason, files, theme) {
22
+ let msg = `the "svg-icons.yml" files in the "${theme}" theme do not match the API schema.\n${reason}`;
23
+
24
+ const filesListMsg = BaseError.generateFilesListMsg(files, theme);
25
+
26
+ if (filesListMsg.length) {
27
+ msg = `${msg}\n${filesListMsg}`;
28
+ }
29
+
30
+ super(msg);
31
+
32
+ this.name = 'Invalid SVG config';
33
+ }
34
+ }
35
+
36
+ module.exports = SvgIconsSchemaError;
@@ -0,0 +1,41 @@
1
+ const assetsValidation = require('./assets-validator');
2
+ const jsmodulesValidator = require('./jsmodules-validator');
3
+ const svgIconsValidator = require('./svg-icons-validator');
4
+
5
+ const isJSModulesPath = path => /jsmodules([-a-zA-Z\d]*)\.yml$/.test(path);
6
+ const isAssetsPath = path => /assets\.yml$/.test(path);
7
+ const isSvgIconsPath = path => /svg-icons\.yml$/.test(path);
8
+
9
+ module.exports = {
10
+ assetsValidation,
11
+ jsmodulesValidator,
12
+ svgIconsValidator,
13
+
14
+ /**
15
+ * set public path for all validators
16
+ * {string} path
17
+ */
18
+ setPublicPath(path) {
19
+ [assetsValidation, jsmodulesValidator].forEach(validator => validator.setPublicPath(path));
20
+ },
21
+
22
+ /**
23
+ * Run appropriate validator
24
+ * {string} filePath
25
+ * {Object} doc
26
+ * {string} theme
27
+ */
28
+ checkSchema(filePath, doc, theme) {
29
+ if (isJSModulesPath(filePath)) {
30
+ jsmodulesValidator.checkSchema(filePath, doc, theme);
31
+ } else if (isAssetsPath(filePath)) {
32
+ const validSchema = assetsValidation.checkSchema(filePath, doc, theme);
33
+
34
+ if (validSchema) {
35
+ assetsValidation.checkInputsExist(filePath, doc, theme);
36
+ }
37
+ } else if (isSvgIconsPath(filePath)) {
38
+ svgIconsValidator.checkSchema(filePath, doc, theme);
39
+ }
40
+ }
41
+ };
@@ -0,0 +1,55 @@
1
+ const schema = require('./schemas/jsmodules-schema');
2
+ const fullSchema = require('./schemas/jsmodules-schema-full');
3
+ const schemaValidator = require('./schema-validator');
4
+ const {isProdMode} = require('../utils');
5
+ const EventEmitter = require('events');
6
+ const emitter = new EventEmitter();
7
+ const JSModulesSchemaError = require('./errors/jsmodules-schema-error');
8
+
9
+ module.exports = Object.assign({}, schemaValidator, {
10
+ emitter,
11
+
12
+ /**
13
+ * @param {string} filePath
14
+ * @param {Object} doc
15
+ * @param {string} theme
16
+ * @returns {boolean|undefined}
17
+ */
18
+ checkSchema(filePath, doc, theme) {
19
+ return true;
20
+ if (isProdMode()) {
21
+ return;
22
+ }
23
+ const result = this.validateSchema(schema, doc);
24
+
25
+ if (!result.valid) {
26
+ const error = new JSModulesSchemaError(result.formattedError, [filePath], theme);
27
+
28
+ this.emitter.emit('error', error);
29
+ }
30
+
31
+ return result.valid;
32
+ },
33
+
34
+ /**
35
+ * @param {Object} doc
36
+ * @param {Array} files
37
+ * @param {string} theme
38
+ * @returns {boolean|undefined}
39
+ */
40
+ checkFullSchema(doc, files = [], theme) {
41
+ return true;
42
+ if (isProdMode()) {
43
+ return;
44
+ }
45
+ const result = this.validateSchema(fullSchema, doc);
46
+
47
+ if (!result.valid) {
48
+ const error = new JSModulesSchemaError(result.formattedError, files, theme);
49
+
50
+ this.emitter.emit('error', error);
51
+ }
52
+
53
+ return result.valid;
54
+ }
55
+ });
@@ -0,0 +1,62 @@
1
+ const {validate} = require('schema-utils');
2
+
3
+ module.exports = {
4
+ /**
5
+ * Symfony public directory path related to application root folder
6
+ * {string}
7
+ */
8
+ _publicPath: 'public/',
9
+
10
+ setPublicPath(path) {
11
+ this._publicPath = path;
12
+ },
13
+
14
+ /**
15
+ * Validates data according to the schema
16
+ * @param {Object} scheme
17
+ * @param {Object} data
18
+ * @param {Object} [options]
19
+ * @returns {Object}
20
+ */
21
+ validateSchema(scheme, data, options) {
22
+ const result = {
23
+ valid: true
24
+ };
25
+
26
+ try {
27
+ const baseDataPath = 'configuration';
28
+ const basePathReg = /^configuration\./;
29
+ validate(scheme, data, {
30
+ baseDataPath,
31
+ ...options || {},
32
+ postFormatter(formattedError, error) {
33
+ if (result.formattedError === void 0) {
34
+ result.formattedError = [];
35
+ }
36
+ result.error = error;
37
+
38
+ if (
39
+ Array.isArray(error.params.type) ||
40
+ error.params.missingProperty
41
+ ) {
42
+ // remove an excess line break
43
+ formattedError = formattedError.replace(/\n/g, ' ');
44
+ }
45
+
46
+ formattedError = formattedError.replace(basePathReg, '');
47
+ result.formattedError.push(formattedError.trim());
48
+ return formattedError;
49
+ }
50
+ });
51
+ } catch (e) {
52
+ result.valid = false;
53
+ result.errorMessage = e.message;
54
+ }
55
+
56
+ if (result.formattedError) {
57
+ result.formattedError = result.formattedError.join('\n');
58
+ }
59
+
60
+ return result;
61
+ }
62
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Schema to validate assets.yml files
3
+ *
4
+ * @description
5
+ * Full scheme complements "assets-schema" one.
6
+ * It should have only rules which are not defined in "assets-schema" schema due to avoid duplicates in error messages
7
+ */
8
+ module.exports = {
9
+ type: 'object',
10
+ patternProperties: {
11
+ '.*': {
12
+ type: 'object',
13
+ properties: {
14
+ inputs: {
15
+ description: 'The "inputs" property is an array of files to load.',
16
+ minItems: 1
17
+ }
18
+ },
19
+ required: ['inputs', 'output']
20
+ }
21
+ }
22
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Schema to validate assets.yml files
3
+ */
4
+ module.exports = {
5
+ type: 'object',
6
+ patternProperties: {
7
+ '.*': {
8
+ type: 'object',
9
+ properties: {
10
+ inputs: {
11
+ description: 'The "inputs" property is an array of files to load.',
12
+ type: 'array',
13
+ items: {
14
+ type: ['string', 'object']
15
+ }
16
+ },
17
+ output: {
18
+ description: 'Output file path inside "public/" directory for the entry point',
19
+ type: 'string'
20
+ },
21
+ auto_rtl_inputs: {
22
+ description: 'List of wildcard file masks for inputs that has to be processed with RTL plugin.',
23
+ type: 'array',
24
+ items: {
25
+ type: 'string'
26
+ }
27
+ }
28
+ },
29
+ additionalProperties: false
30
+ }
31
+ }
32
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Schema to validate jsmodules.yml files
3
+ *
4
+ * @description
5
+ * Full scheme complements "jsmodules-schema" one.
6
+ * It should have only rules which are not defined in "jsmodules-schema" schema due to avoid duplicates in error messages
7
+ */
8
+ module.exports = {
9
+ type: 'object',
10
+ required: ['entry']
11
+ };
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Schema to validate jsmodules.yml files
3
+ */
4
+ module.exports = {
5
+ type: 'object',
6
+ properties: {
7
+ 'entry': {
8
+ description: 'Webpack entry points configuration.',
9
+ type: 'object',
10
+ patternProperties: {
11
+ '.*': {
12
+ type: 'array',
13
+ items: {
14
+ type: 'string'
15
+ }
16
+ }
17
+ }
18
+ },
19
+ 'shim': {
20
+ description: 'Configure a webpack shimming feature',
21
+ type: 'object',
22
+ patternProperties: {
23
+ '.*': {
24
+ type: 'object'
25
+ }
26
+ }
27
+ },
28
+ 'map': {
29
+ description: 'The map option allows to substitute a module with the given ID with a different module.',
30
+ type: 'object',
31
+ patternProperties: {
32
+ '.*': {
33
+ type: 'object'
34
+ }
35
+ }
36
+ },
37
+ 'app-modules': {
38
+ description: 'Introduces a list of modules that should be initialized before application is launched.',
39
+ type: 'array',
40
+ items: {
41
+ type: 'string'
42
+ }
43
+ },
44
+ 'dynamic-imports': {
45
+ description: 'Gives possibility to import a module with the name that is determined at runtime.',
46
+ type: 'object',
47
+ patternProperties: {
48
+ '.*': {
49
+ type: 'array',
50
+ items: {
51
+ type: 'string'
52
+ }
53
+ }
54
+ }
55
+ },
56
+ 'configs': {
57
+ description: 'Runtime configuration for a the module.',
58
+ type: 'object',
59
+ patternProperties: {
60
+ '.*': {
61
+ type: 'object'
62
+ }
63
+ }
64
+ },
65
+ 'aliases': {
66
+ description: 'An alias is an alternative name.',
67
+ type: 'object',
68
+ patternProperties: {
69
+ '.*': {
70
+ type: 'string'
71
+ }
72
+ }
73
+ }
74
+ },
75
+ additionalProperties: false
76
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Schema to validate svg-icons.yml files
3
+ *
4
+ * @description
5
+ * Full scheme complements "svg-icons-schema" one.
6
+ * It should have only rules which are not defined in "svg-icons-schema" schema due to avoid duplicates in error messages
7
+ */
8
+
9
+ module.exports = {
10
+ type: 'object',
11
+ properties: {
12
+ exclude: {
13
+ description: 'The "exclude" property is an array of svg files to exclude from svg sprite.',
14
+ type: 'array',
15
+ minItems: 0
16
+ }
17
+ }
18
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Schema to validate svg-icons.yml files
3
+ */
4
+
5
+ module.exports = {
6
+ type: 'object',
7
+ properties: {
8
+ exclude: {
9
+ description: 'List of SVG files to exclude a from svg sprite.',
10
+ type: 'array',
11
+ items: {
12
+ type: 'string'
13
+ }
14
+ }
15
+ },
16
+ additionalProperties: false
17
+ };
@@ -0,0 +1,53 @@
1
+ const schema = require('./schemas/svg-icons-schema');
2
+ const fullSchema = require('./schemas/svg-icons-schema-full');
3
+ const schemaValidator = require('./schema-validator');
4
+ const {isProdMode} = require('../utils');
5
+ const EventEmitter = require('events');
6
+ const emitter = new EventEmitter();
7
+ const SvgIsonsSchemaError = require('./errors/svg-icons-schema-error');
8
+
9
+ module.exports = Object.assign({}, schemaValidator, {
10
+ emitter,
11
+
12
+ /**
13
+ * @param {string} filePath
14
+ * @param {Object} doc
15
+ * @param {string} theme
16
+ * @returns {boolean|undefined}
17
+ */
18
+ checkSchema(filePath, doc, theme) {
19
+ if (isProdMode()) {
20
+ return;
21
+ }
22
+ const result = this.validateSchema(schema, doc);
23
+
24
+ if (!result.valid) {
25
+ const error = new SvgIsonsSchemaError(result.formattedError, [filePath], theme);
26
+
27
+ this.emitter.emit('error', error);
28
+ }
29
+
30
+ return result.valid;
31
+ },
32
+
33
+ /**
34
+ * @param {Object} doc
35
+ * @param {Array} files
36
+ * @param {string} theme
37
+ * @returns {boolean|undefined}
38
+ */
39
+ checkFullSchema(doc, files = [], theme) {
40
+ if (isProdMode()) {
41
+ return;
42
+ }
43
+ const result = this.validateSchema(fullSchema, doc);
44
+
45
+ if (!result.valid) {
46
+ const error = new SvgIsonsSchemaError(result.formattedError, files, theme);
47
+
48
+ this.emitter.emit('error', error);
49
+ }
50
+
51
+ return result.valid;
52
+ }
53
+ });
@@ -12,7 +12,7 @@ class ConfigsFileWriter {
12
12
  /**
13
13
  * Write app-modules.js file and return file path
14
14
  *
15
- * @param {Array} configs List of configurable modules
15
+ * @param {Object} configs List of configurable modules
16
16
  * @param {string} output Output file path
17
17
  * @returns {string} JS file path of an output file
18
18
  */
@@ -19,9 +19,9 @@ class DynamicImportsFileWriter {
19
19
  write(dynamicImports, output) {
20
20
  const buildPath = path.join(output, 'dynamic-imports.js');
21
21
  let content = Object.entries(dynamicImports).map(([chunkName, moduleNames]) => {
22
- return moduleNames.map(moduleName =>
23
- `'${moduleName}': function() { return import(/* webpackChunkName: "${chunkName}" */ '${moduleName}') }`
24
- );
22
+ const notation = chunkName === 'commons'
23
+ ? '/* webpackMode: "eager" */' : `/* webpackChunkName: "${chunkName}" */`;
24
+ return moduleNames.map(moduleName =>`'${moduleName}': () => import(${notation}'${moduleName}')`);
25
25
  });
26
26
  content = `module.exports = {\n ${content.flat().join(',\n ')}\n};\n`;
27
27
  const filepath = path.resolve(this._publicPath + buildPath);
@@ -25,7 +25,7 @@ class SCSSEntryPointFileWriter {
25
25
  input = input.replace(/\.[^/.]+$/, '');
26
26
  // don't add the base path to global node modules,
27
27
  // e.g. '~bootstrap/scss/bootstrap'
28
- const basePath = input.startsWith('~') ? '': baseInputPath;
28
+ const basePath = input.startsWith('~') ? '' : baseInputPath;
29
29
  let importModule = `@import "${basePath}${input}";\n`;
30
30
  if (ignoreRTL) {
31
31
  importModule = `/*rtl:begin:ignore*/\n${importModule}/*rtl:end:ignore*/\n`;