@rws-framework/client 2.2.2 → 2.3.0

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.
@@ -0,0 +1,12 @@
1
+ declare const _DEFAULT_CONFIG: any;
2
+
3
+ declare function readConfigFile(filePath: string): any;
4
+ declare function get(key: string): any;
5
+ declare function exportConfig(): any;
6
+
7
+ export {
8
+ readConfigFile,
9
+ get,
10
+ exportConfig,
11
+ _DEFAULT_CONFIG
12
+ };
@@ -1,26 +1,15 @@
1
1
  const fs = require('fs');
2
2
  const json5 = require('json5');
3
3
 
4
+ const _DEFAULT_CONFIG = require('./cfg/_default.cfg')._DEFAULT_CONFIG;
5
+ const STORAGE = require('./cfg/_storage');
4
6
 
5
- const _STORAGE = { _loaded: false }
6
-
7
- const _DEFAULT_CONFIG = {
8
- dev: false,
9
- hot: false,
10
- report: false,
11
- backendUrl: null,
12
- wsUrl: null,
13
- transports: ['websocket'],
14
- parted: true,
15
- partedFileDir: './build',
16
- partedPrefix: 'rws',
17
- publicDir: './public',
18
- publicIndex: 'index.html',
19
- pubUrlPrefix: '/',
20
- outputFileName: 'client.rws.js'
21
- }
22
7
 
23
8
  function readConfigFile(filePath){
9
+ if(!fs.existsSync(filePath)){
10
+ return _DEFAULT_CONFIG;
11
+ }
12
+
24
13
  const fileConfig = json5.parse(fs.readFileSync(filePath, 'utf-8'));
25
14
 
26
15
  return {
@@ -30,22 +19,26 @@ function readConfigFile(filePath){
30
19
  }
31
20
 
32
21
  function get(key){
33
- if(!_STORAGE._loaded){
34
- Object.assign(_STORAGE, readConfigFile(process.cwd() + '/.rws.json'));
22
+ _init();
35
23
 
36
- console.log(_STORAGE);
37
- }
24
+ return STORAGE.get(key);
25
+ }
38
26
 
39
- if(Object.keys(_STORAGE).includes(key)){
40
- return _STORAGE[key];
41
- }
27
+ function exportConfig(){
28
+ _init();
42
29
 
43
- return null;
30
+ return STORAGE.getAll();
44
31
  }
45
32
 
33
+ function _init(){
34
+ if(!STORAGE.isLoaded()){
35
+ STORAGE.init(readConfigFile(process.cwd() + '/.rws.json'))
36
+ }
37
+ }
46
38
 
47
39
  module.exports = {
48
40
  readConfigFile,
41
+ exportConfig,
49
42
  get,
50
43
  _DEFAULT_CONFIG
51
44
  };
@@ -0,0 +1,23 @@
1
+ const _DEFAULT_CONFIG_VARS = {
2
+ //Build configs
3
+ dev: false,
4
+ hot: false,
5
+ report: false,
6
+ publicDir: './public',
7
+ publicIndex: 'index.html',
8
+ outputFileName: 'client.rws.js',
9
+ outputDir: './build',
10
+ //Frontend RWS client configs
11
+ backendUrl: null,
12
+ wsUrl: null,
13
+ partedDirUrlPrefix: '/lib/rws',
14
+ partedPrefix: 'rws',
15
+ pubUrlFilePrefix: '/',
16
+ //Universal configs
17
+ transports: ['websocket'],
18
+ parted: true,
19
+ }
20
+
21
+ const _DEFAULT_CONFIG = Object.freeze(_DEFAULT_CONFIG_VARS);
22
+
23
+ module.exports = {_DEFAULT_CONFIG};
@@ -0,0 +1,22 @@
1
+ interface Storage {
2
+ _loaded: boolean;
3
+ data: {
4
+ [key: string]: any;
5
+ };
6
+ }
7
+
8
+ declare const _STORAGE: Readonly<Storage>;
9
+
10
+ declare function get(key: string): any | null;
11
+ declare function getAll(): any;
12
+ declare function init(json: any): void;
13
+ declare function has(key: string): boolean;
14
+ declare function isLoaded(): boolean;
15
+
16
+ export {
17
+ get,
18
+ getAll,
19
+ has,
20
+ init,
21
+ isLoaded
22
+ };
@@ -0,0 +1,43 @@
1
+ class Storage {
2
+ static _instance;
3
+
4
+ _loaded = false;
5
+ data = {}
6
+
7
+ static create(){
8
+ if(!this._instance){
9
+ this._instance = new Storage();
10
+ }
11
+
12
+ return this._instance;
13
+ }
14
+ }
15
+
16
+ const _STORAGE = Storage.create();
17
+
18
+ function get(key){
19
+ if(!has(key)){
20
+ return null;
21
+ }
22
+
23
+ return _STORAGE.data[key];
24
+ }
25
+
26
+ function getAll(){
27
+ return _STORAGE.data;
28
+ }
29
+
30
+ function init(json){
31
+ _STORAGE.data = json;
32
+ _STORAGE._loaded = true;
33
+ }
34
+
35
+ function has(key){
36
+ return Object.keys(_STORAGE.data).includes(key);
37
+ }
38
+
39
+ function isLoaded(){
40
+ return _STORAGE._loaded;
41
+ }
42
+
43
+ module.exports = {get, getAll, has, init, isLoaded}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.2.2",
4
+ "version": "2.3.0",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
@@ -1,71 +1,66 @@
1
1
  const path = require('path');
2
- const webpack = require('webpack');
3
2
  const fs = require('fs');
4
- const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
5
- const JsMinimizerPlugin = require('terser-webpack-plugin');
6
- const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
3
+ const webpack = require('webpack');
4
+ const uglify = require('uglify-js')
7
5
  const HtmlWebpackPlugin = require('html-webpack-plugin');
8
6
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
7
+
9
8
  const RWSAfterPlugin = require('./webpack/rws_after_plugin');
10
- const { Console } = require('console');
11
- const { Interface } = require('readline');
12
- const ts = require('typescript');
13
9
  const tools = require('./_tools');
14
10
  const BuildConfigurator = require('./_rws_build_configurator');
11
+
15
12
  const TerserPlugin = require('terser-webpack-plugin');
16
13
  const HtmlMinifier = require('html-minifier').minify;
17
- const { CleanWebpackPlugin } = require("clean-webpack-plugin");
18
-
19
- let WEBPACK_PLUGINS = [];
20
-
21
- /**
22
- * The RWS webpack configurator.
23
- *
24
- * Example usage in importing file:
25
- *
26
- * RWSWebpackWrapper({
27
- dev: true,
28
- hot: false,
29
- tsConfigPath: executionDir + '/tsconfig.json',
30
- entry: `${executionDir}/src/index.ts`,
31
- executionDir: executionDir,
32
- publicDir: path.resolve(executionDir, 'public'),
33
- outputDir: path.resolve(executionDir, 'build'),
34
- outputFileName: 'jtrainer.client.js',
35
- copyToDir: {
36
- '../public/js/' : [
37
- './build/jtrainer.client.js',
38
- './build/jtrainer.client.js.map',
39
- './src/styles/compiled/main.css'
40
- ]
41
- },
42
- plugins: [
43
-
44
- ],
45
- });
46
- */
47
- const RWSWebpackWrapper = (config) => {
48
- const executionDir = config.executionDir || process.cwd();
14
+ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
15
+ const JsMinimizerPlugin = require('terser-webpack-plugin');
49
16
 
50
- const isDev = config.dev || BuildConfigurator.get('dev');
51
- const isHotReload = config.hot || BuildConfigurator.get('hot');
52
- const isReport = config.report || BuildConfigurator.get('report');
53
- const outputDir = config.outputDir || BuildConfigurator.get('outputDir');
54
- const outputFileName = config.outputFileName || BuildConfigurator.get('outputFileName');
17
+ const json5 = require('json5');
55
18
 
56
- const publicDir = config.publicDir || BuildConfigurator.get('publicDir');
57
- const serviceWorkerPath = config.serviceWorker || BuildConfigurator.get('serviceWorker');
58
19
 
59
- const WEBPACK_AFTER_ACTIONS = config.actions || [];
20
+ const RWSWebpackWrapper = (config) => {
21
+ const executionDir = config.executionDir || process.cwd();
22
+
23
+ const isDev = BuildConfigurator.get('dev') || config.dev;
24
+ const isHotReload = BuildConfigurator.get('hot') || config.hot;
25
+ const isReport = BuildConfigurator.get('report') || config.report;
26
+
27
+ const isParted = BuildConfigurator.get('parted') || config.parted;
28
+ const partedPrefix = BuildConfigurator.get('partedPrefix') || config.partedPrefix;
29
+ const partedDirUrlPrefix = BuildConfigurator.get('partedDirUrlPrefix') || config.partedDirUrlPrefix;
30
+
31
+ const partedComponentsLocations = BuildConfigurator.get('partedComponentsLocations') || config.partedComponentsLocations;
32
+ const customServiceLocations = BuildConfigurator.get('customServiceLocations') || config.customServiceLocations;
33
+ const outputDir = BuildConfigurator.get('outputDir') || config.outputDir;
34
+ const outputFileName = BuildConfigurator.get('outputFileName') || config.outputFileName;
35
+ const publicDir = BuildConfigurator.get('publicDir') || config.publicDir;
36
+ const serviceWorkerPath = BuildConfigurator.get('serviceWorker') || config.serviceWorker;
37
+
38
+ const publicIndex = BuildConfigurator.get('publicIndex') || config.publicIndex;
39
+
40
+
41
+ let WEBPACK_PLUGINS = [
42
+ new webpack.DefinePlugin({
43
+ 'process.env._RWS_DEFAULTS': JSON.stringify(BuildConfigurator.exportConfig())
44
+ }),
45
+ new webpack.BannerPlugin({
46
+ banner: `if(!window.RWS){
47
+ const script = document.createElement('script');
48
+ script.src = '${partedDirUrlPrefix}/${partedPrefix}.vendors.js';
49
+ script.type = 'text/javascript';
50
+ document.body.appendChild(script);
51
+ }`.replace('\n', ''),
52
+ raw: true,
53
+ entryOnly: true,
54
+ // include: 'client'
55
+ }),
56
+ new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en-gb/)
57
+ ];
60
58
 
61
- const publicIndex = config.publicIndex || BuildConfigurator.get('publicIndex');
59
+ const WEBPACK_AFTER_ACTIONS = config.actions || [];
62
60
 
63
61
  const aliases = config.aliases = {};
64
-
65
62
  aliases.fs = false;
66
-
67
63
  const modules_setup = [path.resolve(__dirname, 'node_modules'), 'node_modules'];
68
-
69
64
  const overridePlugins = config.plugins || []
70
65
 
71
66
  if (isHotReload) {
@@ -81,7 +76,7 @@ const RWSWebpackWrapper = (config) => {
81
76
  WEBPACK_PLUGINS = [...WEBPACK_PLUGINS, new webpack.optimize.ModuleConcatenationPlugin(), ...overridePlugins];
82
77
 
83
78
 
84
- if (isDev && isReport) {
79
+ if (isReport) {
85
80
  WEBPACK_PLUGINS.push(new BundleAnalyzerPlugin({
86
81
  analyzerMode: 'static',
87
82
  openAnalyzer: false,
@@ -95,10 +90,12 @@ const RWSWebpackWrapper = (config) => {
95
90
  });
96
91
  }
97
92
 
98
- if (!!config.copyToDir) {
93
+ const assetsToCopy = config.copyAssets || BuildConfigurator.get('copyAssets');
94
+
95
+ if (!!assetsToCopy) {
99
96
  WEBPACK_AFTER_ACTIONS.push({
100
97
  type: 'copy',
101
- actionHandler: config.copyToDir
98
+ actionHandler: assetsToCopy
102
99
  });
103
100
  }
104
101
 
@@ -120,13 +117,14 @@ const RWSWebpackWrapper = (config) => {
120
117
  path.resolve(executionDir, 'src', 'services')
121
118
  ];
122
119
 
123
- if (config.customServiceLocations) {
124
- config.customServiceLocations.forEach((serviceDir) => {
120
+ if (customServiceLocations) {
121
+ customServiceLocations.forEach((serviceDir) => {
125
122
  servicesLocations.push(serviceDir);
126
123
  });
127
124
  }
128
125
 
129
126
  const optimConfig = {
127
+ minimize: true,
130
128
  minimizer: isDev ? [] : [
131
129
  new TerserPlugin({
132
130
  terserOptions: {
@@ -140,16 +138,16 @@ const RWSWebpackWrapper = (config) => {
140
138
  comments: false
141
139
  },
142
140
  },
143
- extractComments: false
141
+ extractComments: false,
142
+ parallel: true,
144
143
  }),
145
144
  new CssMinimizerPlugin(),
146
-
147
145
  ],
148
146
  };
149
147
 
150
- if (config.parted) {
151
- if (config.partedComponentsLocations) {
152
- config.partedComponentsLocations.forEach((componentDir) => {
148
+ if (isParted) {
149
+ if (partedComponentsLocations) {
150
+ partedComponentsLocations.forEach((componentDir) => {
153
151
  RWSComponents = [...RWSComponents, ...(tools.findComponentFilesWithText(path.resolve(componentDir), '@RWSView', ['dist', 'node_modules', '@rws-framework/client']))];
154
152
  });
155
153
  }
@@ -207,8 +205,8 @@ const RWSWebpackWrapper = (config) => {
207
205
  target: 'web',
208
206
  devtool: isDev ? (config.devtool || 'inline-source-map') : false,
209
207
  output: {
210
- path: config.outputDir,
211
- filename: config.parted ? (config.partedPrefix || 'rws') + '.[name].js' : config.outputFileName,
208
+ path: outputDir,
209
+ filename: isParted ? (partedPrefix || 'rws') + '.[name].js' : outputFileName,
212
210
  sourceMapFilename: '[file].map',
213
211
  },
214
212
  resolve: {
package/src/client.ts CHANGED
@@ -39,7 +39,7 @@ class RWSClient {
39
39
  private _container: Container;
40
40
  private user: IRWSUser = null;
41
41
 
42
- private config: IRWSConfig = { backendUrl: '', routes: {}, splitFileDir: '/', splitPrefix: 'rws' };
42
+ private config: IRWSConfig = { backendUrl: '', routes: {}, partedFileDir: '/', partedPrefix: 'rws' };
43
43
  protected initCallback: () => Promise<void> = async () => { };
44
44
 
45
45
  private isSetup = false;
@@ -106,9 +106,7 @@ class RWSClient {
106
106
 
107
107
  if (Object.keys(config).length) {
108
108
  this.appConfig.mergeConfig(this.config);
109
- }
110
-
111
- console.log(this.isSetup, this.config, this.appConfig);
109
+ }
112
110
 
113
111
  if (this.config.user && !this.config.dontPushToSW) {
114
112
  this.pushUserToServiceWorker(this.user);
@@ -116,6 +114,8 @@ class RWSClient {
116
114
 
117
115
  await startClient(this.appConfig, this.wsService, this.notifyService, this.routingService);
118
116
 
117
+ RWSClient.defineAllComponents();
118
+
119
119
  await this.initCallback();
120
120
 
121
121
  return this;
@@ -223,35 +223,17 @@ class RWSClient {
223
223
  async loadPartedComponents(): Promise<void> {
224
224
  this.assignClientToBrowser();
225
225
 
226
- const componentParts: string[] = await this.apiService.get<string[]>(this.appConfig.get('splitFileDir') + '/rws_chunks_info.json');
227
-
228
- const _all: Promise<string>[] = [];
229
- componentParts.forEach((componentName: string) => {
230
-
231
- const scriptUrl: string = this.appConfig.get('splitFileDir') + `/${this.appConfig.get('splitPrefix')}.${componentName}.js`; // Replace with the path to your script file
232
-
233
-
226
+ const componentParts: string[] = await this.apiService.get<string[]>(this.appConfig.get('partedDirUrlPrefix') + '/rws_chunks_info.json');
234
227
 
235
- const headers: any = {};
236
-
237
- headers['Content-Type'] = 'application/javascript';
238
-
239
- _all.push(this.apiService.pureGet(scriptUrl, {
240
- headers
241
- }));
242
- });
243
-
244
- (await Promise.all(_all)).forEach((scriptCnt: string, key: number) => {
228
+ componentParts.forEach((componentName: string, key: number) => {
245
229
  const script: HTMLScriptElement = document.createElement('script');
246
- script.textContent = scriptCnt;
230
+ script.src = `${this.appConfig.get('partedDirUrlPrefix')}/${this.appConfig.get('partedPrefix')}.${componentName}.js`;
247
231
  script.async = true;
248
232
  script.type = 'text/javascript';
249
233
  document.body.appendChild(script);
250
234
 
251
235
  console.log(`Appended ${componentParts[key]} component`);
252
- });
253
-
254
- RWSClient.defineAllComponents();
236
+ });
255
237
  }
256
238
 
257
239
  async onDOMLoad(): Promise<void> {
@@ -290,9 +272,7 @@ class RWSClient {
290
272
 
291
273
  static defineAllComponents() {
292
274
  const richWindowComponents: RWSWindowComponentRegister = (window as Window & RWSWindow).RWS.components;
293
- // provideRWSDesignSystem().register(richWindowComponents[devStr].component);
294
-
295
- console.log(richWindowComponents);
275
+
296
276
  Object.keys(richWindowComponents).map(key => richWindowComponents[key].component).forEach((el: IWithCompose<RWSViewComponent>) => {
297
277
  el.define(el as any, el.definition);
298
278
  });
@@ -81,7 +81,7 @@ abstract class RWSViewComponent extends FoundationElement implements IRWSViewCom
81
81
  if (this.fileAssets[file]) {
82
82
  return;
83
83
  }
84
- this.utilsService.getFileContents(this.config.get('pubUrlPrefix') + file).then((response: string) => {
84
+ this.utilsService.getFileContents(this.config.get('pubUrlFilePrefix') + file).then((response: string) => {
85
85
  this.fileAssets = { ...this.fileAssets, [file]: html`${response}` };
86
86
  });
87
87
  });
@@ -0,0 +1,43 @@
1
+ import 'reflect-metadata';
2
+ import IRWSConfig from '../../interfaces/IRWSConfig.js';
3
+
4
+
5
+ function RWSFillBuild(config?: Partial<IRWSConfig>) {
6
+ return function <T extends { new(...args: any[]): {} }>(constructor: T) {
7
+ return class extends constructor {
8
+ _DEFAULTS: IRWSConfig;
9
+ constructor(...args: any[]) {
10
+ super(...args);
11
+
12
+ const extractedDefaults = JSON.parse(JSON.stringify(process.env._RWS_DEFAULTS));
13
+
14
+ const {
15
+ backendUrl,
16
+ wsUrl,
17
+ partedDirUrlPrefix,
18
+ partedPrefix,
19
+ pubUrlFilePrefix,
20
+ transports,
21
+ parted
22
+ } = extractedDefaults;
23
+
24
+ const extractedFrontendDefaults = {
25
+ backendUrl,
26
+ wsUrl,
27
+ partedDirUrlPrefix,
28
+ partedPrefix,
29
+ pubUrlFilePrefix,
30
+ transports,
31
+ parted
32
+ };
33
+
34
+ this._DEFAULTS = {
35
+ ...config,
36
+ ...extractedFrontendDefaults
37
+ };
38
+ }
39
+ };
40
+ };
41
+ }
42
+
43
+ export { RWSFillBuild }
@@ -3,12 +3,6 @@ import { RouterComponent } from './router/component';
3
3
  import { RWSProgress } from './progress/component';
4
4
  import { RWSLoader } from './loader/component';
5
5
 
6
- const RWSComponents = {
7
- RWSUploader,
8
- RouterComponent,
9
- RWSProgress,
10
- RWSLoader
11
- };
12
6
 
13
7
  function declareRWSComponents(parted: boolean = false): void
14
8
  {
@@ -20,4 +14,4 @@ function declareRWSComponents(parted: boolean = false): void
20
14
  }
21
15
  }
22
16
 
23
- export { RWSComponents, declareRWSComponents };
17
+ export { declareRWSComponents };
package/src/index.ts CHANGED
@@ -29,7 +29,7 @@ import {
29
29
 
30
30
  import { RWSDecoratorOptions, RWSIgnore, RWSView, RWSInject } from './components/_decorator';
31
31
 
32
- import { RWSComponents, declareRWSComponents } from './components';
32
+ import { declareRWSComponents } from './components';
33
33
 
34
34
  export default RWSClient;
35
35
  export {
@@ -82,8 +82,6 @@ export {
82
82
  ngAttr,
83
83
 
84
84
  renderRouteComponent,
85
-
86
- RWSComponents,
87
85
 
88
86
  observable,
89
87
  attr,
@@ -12,7 +12,8 @@ export default interface IRWSConfig {
12
12
  user?: any
13
13
  ignoreRWSComponents?: boolean
14
14
  pubUrl?: string
15
- pubUrlPrefix?: string
15
+ pubUrlFilePrefix?: string
16
+ partedDirUrlPrefix?: string
16
17
  dontPushToSW?: boolean
17
18
  parted?: boolean
18
19
  partedFileDir?: string
@@ -1,36 +1,40 @@
1
1
  import TheService from './_service';
2
2
  import IRWSConfig from '../interfaces/IRWSConfig';
3
- import { RWSFillBuildConfig } from '../components/_decorators/RWSFillBuildConfig';
3
+ import { RWSFillBuild } from '../components/_decorators/RWSFillBuild';
4
+
5
+
4
6
 
5
- @RWSFillBuildConfig()
6
- const _DEFAULTS: IRWSConfig = {
7
- pubUrlPrefix: '/',
8
- pubUrl : window.origin,
9
- partedFileDir: '/',
10
- partedPrefix: 'rws'
11
- }
12
7
 
13
8
  const __SENT_TO_COMPONENTS: string[] = [];
14
9
 
10
+ @RWSFillBuild({
11
+ pubUrlFilePrefix: '/',
12
+ pubUrl: window.origin,
13
+ partedFileDir: '/',
14
+ partedPrefix: 'rws',
15
+ })
15
16
  class ConfigService extends TheService {
16
17
  static isLoaded: boolean = false;
17
-
18
+ _DEFAULTS: any = null;
18
19
  private data: IRWSConfig = {};
19
20
 
20
21
  constructor() {
21
- super();
22
+ super();
22
23
  }
23
24
 
24
25
  public get(key: keyof IRWSConfig): any
25
- {
26
-
26
+ {
27
+ if(!this._DEFAULTS){
28
+ throw new Error('No _DEFAULTS loaded!')
29
+ }
30
+
27
31
  const isInData: boolean = Object.keys(this.data).includes(key);
28
- const isInDefaults: boolean = Object.keys(_DEFAULTS).includes(key);
32
+ const isInDefaults: boolean = Object.keys(this._DEFAULTS).includes(key);
29
33
 
30
34
  if(!isInData && isInDefaults){
31
- let defaultVal = _DEFAULTS[key];
32
-
33
- if(defaultVal[0] === '@'){
35
+ let defaultVal = this._DEFAULTS[key];
36
+ console.log(key, 'kk')
37
+ if(defaultVal && defaultVal[0] === '@'){
34
38
  defaultVal = this.data[((defaultVal as string).slice(1)) as keyof IRWSConfig];
35
39
  }
36
40
 
@@ -35,6 +35,28 @@ class RWSAfterPlugin {
35
35
  return await Promise.all(proms);
36
36
  });
37
37
  });
38
+
39
+ compiler.hooks.emit.tapAsync('RWSAfterPlugin', (compilation, callback) => {
40
+ Object.keys(compilation.assets).forEach((filename) => {
41
+
42
+ if (filename.endsWith('.js')) {
43
+ const asset = compilation.assets[filename];
44
+ let source = asset.source();
45
+ if(source.indexOf('css`') > -1 || source.indexOf('html`') > -1){
46
+ console.log('replacing', filename);
47
+ const updatedSource = source.replace(/\n/g, '');
48
+
49
+ // Update the asset with the new content
50
+ compilation.assets[filename] = {
51
+ source: () => updatedSource,
52
+ size: () => updatedSource.length
53
+ };
54
+ }
55
+ }
56
+ });
57
+
58
+ callback();
59
+ });
38
60
  }
39
61
 
40
62
  async _runActionType(actionType, action){
@@ -124,19 +124,6 @@ class RWSPlugin {
124
124
  const _self = this;
125
125
 
126
126
  return;
127
-
128
- compiler.hooks.thisCompilation.tap('RWSSassPlugin', (compilation) => {
129
- compilation.hooks.buildModule.tap('RWSSassPlugin', (module) => {
130
- if (module.resource && /\.scss$/.test(module.resource)) {
131
-
132
- let scssPath = module.resource;
133
-
134
- this.compileFile(scssPath, true).catch((e) => {
135
- throw e;
136
- })
137
- }
138
- });
139
- });
140
127
  }
141
128
 
142
129
  readSCSSFilesFromDirectory(dirPath) {
@@ -1,14 +0,0 @@
1
- import { Key } from '@microsoft/fast-foundation';
2
-
3
- import 'reflect-metadata';
4
- import IRWSConfig from '../../interfaces/IRWSConfig';
5
-
6
- type FillBuildDecoratorReturnType = (target: any, key?: string | number | undefined, parameterIndex?: number) => void;
7
-
8
- function RWSFillBuildConfig(dependencyClass: Key): FillBuildDecoratorReturnType {
9
- return (target: IRWSConfig, key?: string | number, parameterIndex?: number) => {
10
- console.log('ONBUILD', target, key, parameterIndex);
11
- };
12
- }
13
-
14
- export { RWSFillBuildConfig }