@rws-framework/client 2.7.0 → 2.7.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.7.0",
4
+ "version": "2.7.1",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -220,7 +220,8 @@ const RWSWebpackWrapper = (config) => {
220
220
  throw new Error('RWS Webpack build failed.');
221
221
  }
222
222
 
223
- const cfgExport = {
223
+ const cfgExport = {
224
+ context: executionDir,
224
225
  entry: {
225
226
  client: config.entry,
226
227
  ...automatedEntries
@@ -233,7 +234,7 @@ const RWSWebpackWrapper = (config) => {
233
234
  filename: isParted ? (partedPrefix || 'rws') + '.[name].js' : outputFileName,
234
235
  sourceMapFilename: '[file].map',
235
236
  },
236
- resolve: {
237
+ resolve: {
237
238
  extensions: ['.ts', '.js'],
238
239
  modules: modules_setup,
239
240
  alias: {
@@ -44,7 +44,11 @@ class RWSScssPlugin {
44
44
  const importPath = match[1];
45
45
  const importLine = match[0];
46
46
 
47
- imports.push([this.processImportPath(importPath, path.dirname(importRootPath)), importLine]);
47
+ if(fs.statSync(importRootPath).isFile()){
48
+ importRootPath = path.dirname(importRootPath);
49
+ }
50
+
51
+ imports.push([this.processImportPath(importPath, importRootPath), importLine]);
48
52
  }
49
53
 
50
54
  return [imports, fileContent];
@@ -155,7 +159,7 @@ class RWSScssPlugin {
155
159
  filePath = filePath.replace('//', '/');
156
160
 
157
161
  if (!fs.existsSync(filePath)) {
158
- const processedImportPath = this.processImportPath(filePath, path.dirname(filePath));
162
+ const processedImportPath = this.processImportPath(filePath, path.dirname(filePath));
159
163
 
160
164
  if (!fs.existsSync(processedImportPath)) {
161
165
  throw new Error(`SCSS loader: File path "${filePath}" was not found.`);
@@ -209,9 +213,8 @@ class RWSScssPlugin {
209
213
  imports.forEach(importData => {
210
214
  const originalImportPath = importData[0];
211
215
  let importPath = this.processImportPath(originalImportPath, fileRootDir);
212
-
213
216
  let replacedScssContent = getStorage(importPath, this.getCodeFromFile(importPath).replace(/\/\*[\s\S]*?\*\//g, ''));
214
-
217
+
215
218
  const recursiveImports = this.extractScssImports(replacedScssContent, importPath)[0];
216
219
 
217
220
  if (recursiveImports.length) {
@@ -286,18 +289,18 @@ class RWSScssPlugin {
286
289
  return this.fillSCSSExt(importPath, noext);
287
290
  }
288
291
 
289
- if(fileRootDir){
292
+ if(fileRootDir){
293
+ const relativized = path.resolve(fileRootDir) + '/' + importPath;
294
+
290
295
  if (importPath.split('')[0] === '.') {
291
- return this.fillSCSSExt(path.resolve(fileRootDir, importPath), noext);
296
+ return this.fillSCSSExt(relativized, noext);
292
297
  }
293
298
 
294
- const relativized = path.resolve(fileRootDir) + '/' + importPath;
295
-
296
299
  if (!fs.existsSync(relativized)) {
297
300
  const partSplit = relativized.split('/');
298
301
  partSplit[partSplit.length - 1] = '_' + partSplit[partSplit.length - 1] + '.scss';
299
302
 
300
- const newPath = this.underscorePath(relativized);
303
+ const newPath = this.underscorePath(relativized);
301
304
 
302
305
  if (fs.existsSync(newPath)) {
303
306
  return newPath;