@wavemaker/angular-app 11.7.5-1.5782
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/.npmrc +1 -0
- package/angular.json +269 -0
- package/build-scripts/build.js +35 -0
- package/build-scripts/index-html-transform.js +28 -0
- package/build-scripts/optimize-css.gulpfile.js +101 -0
- package/build-scripts/post-build.js +311 -0
- package/dependencies/app.component.html +28 -0
- package/dependencies/expression-parser.cjs.js +50533 -0
- package/dependencies/pipe-provider.cjs.js +206320 -0
- package/dependencies/transpilation-mobile.cjs.js +93287 -0
- package/dependencies/transpilation-web.cjs.js +104478 -0
- package/package-lock.json +25051 -0
- package/package.json +132 -0
- package/pwa-assets/icons/icon-128x128.png +0 -0
- package/pwa-assets/icons/icon-144x144.png +0 -0
- package/pwa-assets/icons/icon-152x152.png +0 -0
- package/pwa-assets/icons/icon-192x192.png +0 -0
- package/pwa-assets/icons/icon-384x384.png +0 -0
- package/pwa-assets/icons/icon-512x512.png +0 -0
- package/pwa-assets/icons/icon-72x72.png +0 -0
- package/pwa-assets/icons/icon-96x96.png +0 -0
- package/pwa-assets/manifest.json +59 -0
- package/pwa-assets/ngsw-config.json +30 -0
- package/pwa-assets/wmsw-worker.js +24 -0
- package/src/.browserslistrc +12 -0
- package/src/app/app-codegen.module.ts +11 -0
- package/src/app/app.component.css +0 -0
- package/src/app/app.component.script.js +3 -0
- package/src/app/app.component.variables.ts +3 -0
- package/src/app/app.routes.ts +5 -0
- package/src/app/lazy-load-scripts.resolve.ts +20 -0
- package/src/app/prefabs/prefab-config.js +2 -0
- package/src/app/wm-project-properties.ts +3 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/print.css +32 -0
- package/src/environments/environment.dev.ts +3 -0
- package/src/environments/environment.prod.ts +3 -0
- package/src/environments/environment.ts +16 -0
- package/src/framework/angular1.polyfills.ts +36 -0
- package/src/framework/services/app-extension.service.ts +20 -0
- package/src/framework/services/app-js-provider.service.ts +15 -0
- package/src/framework/services/app-variables-provider.service.ts +15 -0
- package/src/framework/services/component-ref-provider.service.ts +40 -0
- package/src/framework/services/lazy-component-ref-provider.service.ts +64 -0
- package/src/framework/services/prefab-config-provider.service.ts +13 -0
- package/src/framework/util/lazy-module-routes.ts +4 -0
- package/src/framework/util/page-util.ts +5 -0
- package/src/index.html +17 -0
- package/src/main.ts +30 -0
- package/src/polyfills.ts +53 -0
- package/src/setup-jest.js +120 -0
- package/src/styles.css +1 -0
- package/src/tsconfig.app.json +14 -0
- package/src/tslint.json +17 -0
- package/tsconfig.json +131 -0
- package/tsconfig.web-app.json +102 -0
- package/wm-custom-webpack.config.js +94 -0
package/.npmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
legacy-peer-deps = true
|
package/angular.json
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"angular-app": {
|
|
7
|
+
"root": "",
|
|
8
|
+
"sourceRoot": "src",
|
|
9
|
+
"projectType": "application",
|
|
10
|
+
"prefix": "app",
|
|
11
|
+
"schematics": {},
|
|
12
|
+
"architect": {
|
|
13
|
+
"build": {
|
|
14
|
+
"builder": "@angular-builders/custom-webpack:browser",
|
|
15
|
+
"options": {
|
|
16
|
+
"customWebpackConfig": {
|
|
17
|
+
"path": "./wm-custom-webpack.config.js"
|
|
18
|
+
},
|
|
19
|
+
"indexTransform": "./build-scripts/index-html-transform.js",
|
|
20
|
+
"deployUrl": "ng-bundle/",
|
|
21
|
+
"outputPath": "dist/ng-bundle",
|
|
22
|
+
"index": {
|
|
23
|
+
"input": "src/index.html",
|
|
24
|
+
"output": "../index.html"
|
|
25
|
+
},
|
|
26
|
+
"main": "src/main.ts",
|
|
27
|
+
"polyfills": "src/polyfills.ts",
|
|
28
|
+
"tsConfig": "src/tsconfig.app.json",
|
|
29
|
+
"assets": [
|
|
30
|
+
"src/favicon.ico",
|
|
31
|
+
"src/assets",
|
|
32
|
+
{
|
|
33
|
+
"glob": "print.css",
|
|
34
|
+
"input": "src/assets/",
|
|
35
|
+
"output": "."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"glob": "**/*",
|
|
39
|
+
"input": "libraries/locales/",
|
|
40
|
+
"output": "/locales/"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"glob": "**/*",
|
|
44
|
+
"input": "node_modules/@wavemaker/app-ng-runtime/locales/",
|
|
45
|
+
"output": "/locales/"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"styles": [
|
|
49
|
+
"src/styles.css",
|
|
50
|
+
"src/assets/styles/css/wm-style.css",
|
|
51
|
+
"src/assets/styles/css/wm-responsive.css",
|
|
52
|
+
{
|
|
53
|
+
"input": "src/assets/themes/material/style.css",
|
|
54
|
+
"inject": false,
|
|
55
|
+
"bundleName": "wm-styles"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"input": "src/assets/app.css",
|
|
59
|
+
"inject": false,
|
|
60
|
+
"bundleName": "wm-styles"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"scripts": [
|
|
64
|
+
"./node_modules/x2js/x2js.js",
|
|
65
|
+
"./node_modules/d3/dist/d3.min.js",
|
|
66
|
+
"./node_modules/@wavemaker/nvd3/build/nv.d3.min.js",
|
|
67
|
+
"./node_modules/jquery/dist/jquery.min.js",
|
|
68
|
+
"./node_modules/jquery-ui/ui/disable-selection.js",
|
|
69
|
+
"./node_modules/jquery-ui/ui/version.js",
|
|
70
|
+
"./node_modules/jquery-ui/ui/widget.js",
|
|
71
|
+
"./node_modules/jquery-ui/ui/scroll-parent.js",
|
|
72
|
+
"./node_modules/jquery-ui/ui/plugin.js",
|
|
73
|
+
"./node_modules/jquery-ui/ui/data.js",
|
|
74
|
+
"./node_modules/jquery-ui/ui/widgets/mouse.js",
|
|
75
|
+
"./node_modules/jquery-ui/ui/widgets/resizable.js",
|
|
76
|
+
"./node_modules/jquery-ui/ui/widgets/sortable.js",
|
|
77
|
+
"./node_modules/jquery-ui/ui/widgets/draggable.js",
|
|
78
|
+
"./node_modules/jquery-ui/ui/widgets/droppable.js",
|
|
79
|
+
"./node_modules/@wavemaker/app-ng-runtime/scripts/datatable/datatable.js",
|
|
80
|
+
"./node_modules/@wavemaker/app-ng-runtime/scripts/swipey/swipey.jquery.plugin.js",
|
|
81
|
+
"./node_modules/@wavemaker/app-ng-runtime/scripts/jquery.ui.touch-punch/jquery.ui.touch-punch.min.js",
|
|
82
|
+
"./node_modules/moment/min/moment.min.js",
|
|
83
|
+
"./node_modules/moment-timezone/builds/moment-timezone.min.js",
|
|
84
|
+
"./node_modules/fullcalendar/main.min.js",
|
|
85
|
+
"./node_modules/summernote/dist/summernote-lite.min.js",
|
|
86
|
+
"./node_modules/hammerjs/hammer.min.js",
|
|
87
|
+
"./node_modules/iscroll/build/iscroll.js",
|
|
88
|
+
"./node_modules/js-cookie/src/js.cookie.js",
|
|
89
|
+
"./node_modules/jssha/dist/sha256.js",
|
|
90
|
+
"./node_modules/@ztree/ztree_v3/js/jquery.ztree.all.js",
|
|
91
|
+
"./node_modules/@wavemaker/app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
"configurations": {
|
|
95
|
+
"production": {
|
|
96
|
+
"fileReplacements": [
|
|
97
|
+
{
|
|
98
|
+
"replace": "src/environments/environment.ts",
|
|
99
|
+
"with": "src/environments/environment.prod.ts"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"optimization": {
|
|
103
|
+
"scripts": true,
|
|
104
|
+
"styles": {
|
|
105
|
+
"minify": true,
|
|
106
|
+
"inlineCritical": false
|
|
107
|
+
},
|
|
108
|
+
"fonts": true
|
|
109
|
+
},
|
|
110
|
+
"outputHashing": "all",
|
|
111
|
+
"sourceMap": false,
|
|
112
|
+
"namedChunks": false,
|
|
113
|
+
"aot": true,
|
|
114
|
+
"extractLicenses": true,
|
|
115
|
+
"vendorChunk": false,
|
|
116
|
+
"buildOptimizer": true,
|
|
117
|
+
"budgets": [
|
|
118
|
+
{
|
|
119
|
+
"type": "initial",
|
|
120
|
+
"maximumWarning": "2mb"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"development": {
|
|
125
|
+
"fileReplacements": [
|
|
126
|
+
{
|
|
127
|
+
"replace": "src/environments/environment.ts",
|
|
128
|
+
"with": "src/environments/environment.dev.ts"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"optimization": false,
|
|
132
|
+
"outputHashing": "none",
|
|
133
|
+
"sourceMap": true,
|
|
134
|
+
"namedChunks": true,
|
|
135
|
+
"aot": true,
|
|
136
|
+
"extractLicenses": false,
|
|
137
|
+
"vendorChunk": true,
|
|
138
|
+
"buildOptimizer": false,
|
|
139
|
+
"budgets": [
|
|
140
|
+
{
|
|
141
|
+
"type": "initial",
|
|
142
|
+
"maximumWarning": "2mb"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"local": {
|
|
147
|
+
"fileReplacements": [
|
|
148
|
+
{
|
|
149
|
+
"replace": "src/environments/environment.ts",
|
|
150
|
+
"with": "src/environments/environment.dev.ts"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"optimization": {
|
|
154
|
+
"scripts": false,
|
|
155
|
+
"styles": {
|
|
156
|
+
"minify": false,
|
|
157
|
+
"inlineCritical": false
|
|
158
|
+
},
|
|
159
|
+
"fonts": true
|
|
160
|
+
},
|
|
161
|
+
"outputHashing": "none",
|
|
162
|
+
"sourceMap": true,
|
|
163
|
+
"namedChunks": true,
|
|
164
|
+
"aot": true,
|
|
165
|
+
"extractLicenses": false,
|
|
166
|
+
"vendorChunk": false,
|
|
167
|
+
"buildOptimizer": true,
|
|
168
|
+
"budgets": [
|
|
169
|
+
{
|
|
170
|
+
"type": "initial",
|
|
171
|
+
"maximumWarning": "2mb"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"defaultConfiguration": "production"
|
|
177
|
+
},
|
|
178
|
+
"build-ng": {
|
|
179
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
180
|
+
"options": {
|
|
181
|
+
"outputPath": "dist",
|
|
182
|
+
"index": {
|
|
183
|
+
"input": "src/index.html",
|
|
184
|
+
"output": "../index.html"
|
|
185
|
+
},
|
|
186
|
+
"main": "src/main.ts",
|
|
187
|
+
"polyfills": "src/polyfills.ts",
|
|
188
|
+
"tsConfig": "src/tsconfig.app.json",
|
|
189
|
+
"assets": [
|
|
190
|
+
"src/favicon.ico",
|
|
191
|
+
"src/assets",
|
|
192
|
+
{
|
|
193
|
+
"glob": "print.css",
|
|
194
|
+
"input": "src/assets/",
|
|
195
|
+
"output": "."
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"styles": [
|
|
199
|
+
"src/styles.css",
|
|
200
|
+
"src/assets/styles/css/wm-style.css",
|
|
201
|
+
"src/assets/themes/material/style.css",
|
|
202
|
+
"src/assets/app.css"
|
|
203
|
+
],
|
|
204
|
+
"scripts": [
|
|
205
|
+
"./node_modules/x2js/x2js.js",
|
|
206
|
+
"./node_modules/d3/dist/d3.min.js",
|
|
207
|
+
"./node_modules/@wavemaker/nvd3/build/nv.d3.min.js",
|
|
208
|
+
"./node_modules/jquery/dist/jquery.min.js",
|
|
209
|
+
"./node_modules/jquery-ui/ui/disable-selection.js",
|
|
210
|
+
"./node_modules/jquery-ui/ui/version.js",
|
|
211
|
+
"./node_modules/jquery-ui/ui/widget.js",
|
|
212
|
+
"./node_modules/jquery-ui/ui/scroll-parent.js",
|
|
213
|
+
"./node_modules/jquery-ui/ui/plugin.js",
|
|
214
|
+
"./node_modules/jquery-ui/ui/data.js",
|
|
215
|
+
"./node_modules/jquery-ui/ui/widgets/mouse.js",
|
|
216
|
+
"./node_modules/jquery-ui/ui/widgets/resizable.js",
|
|
217
|
+
"./node_modules/jquery-ui/ui/widgets/sortable.js",
|
|
218
|
+
"./node_modules/jquery-ui/ui/widgets/droppable.js",
|
|
219
|
+
"./libraries/scripts/datatable/datatable.js",
|
|
220
|
+
"./node_modules/moment/min/moment.min.js",
|
|
221
|
+
"./node_modules/moment-timezone/builds/moment-timezone.min.js",
|
|
222
|
+
"./node_modules/fullcalendar/main.min.js",
|
|
223
|
+
"./node_modules/summernote/dist/summernote-lite.min.js",
|
|
224
|
+
"./node_modules/hammerjs/hammer.min.js",
|
|
225
|
+
"./node_modules/iscroll/build/iscroll.js",
|
|
226
|
+
"./node_modules/js-cookie/src/js.cookie.js",
|
|
227
|
+
"./node_modules/jssha/dist/sha256.js",
|
|
228
|
+
"./node_modules/@ztree/ztree_v3/js/jquery.ztree.all.js",
|
|
229
|
+
"./libraries/scripts/tree-keyboard-navigation/keyboard-navigation.js"
|
|
230
|
+
],
|
|
231
|
+
"aot": false,
|
|
232
|
+
"vendorChunk": true,
|
|
233
|
+
"extractLicenses": false,
|
|
234
|
+
"buildOptimizer": false,
|
|
235
|
+
"sourceMap": true,
|
|
236
|
+
"optimization": false,
|
|
237
|
+
"namedChunks": true
|
|
238
|
+
},
|
|
239
|
+
"configurations": {
|
|
240
|
+
"production": {
|
|
241
|
+
"browserTarget": "angular-app:build:production"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"defaultConfiguration": ""
|
|
245
|
+
},
|
|
246
|
+
"serve": {
|
|
247
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
248
|
+
"options": {
|
|
249
|
+
"buildTarget": "angular-app:build"
|
|
250
|
+
},
|
|
251
|
+
"configurations": {
|
|
252
|
+
"production": {
|
|
253
|
+
"buildTarget": "angular-app:build:production"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"extract-i18n": {
|
|
258
|
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
|
259
|
+
"options": {
|
|
260
|
+
"buildTarget": "angular-app:build"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"cli": {
|
|
267
|
+
"analytics": "fe5e8f46-2dff-4044-b3b8-8a1307278ce6"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const { spawnSync } = require('child_process');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
let processArgs = process.argv;
|
|
5
|
+
if (processArgs.findIndex(arg => arg.startsWith('--max-old-space-size')) !== -1) {
|
|
6
|
+
process.env.NODE_OPTIONS = processArgs.pop();
|
|
7
|
+
console.log("Setting node options: ", process.env.NODE_OPTIONS);
|
|
8
|
+
}
|
|
9
|
+
const args = processArgs.slice(2);
|
|
10
|
+
const ngBuildArgs = ['build', ...args];
|
|
11
|
+
console.log("\x1b[33m", "Angular build params: ", ngBuildArgs);
|
|
12
|
+
|
|
13
|
+
//Trigger angular build with the passed params
|
|
14
|
+
const ngPath = path.resolve(process.cwd(), 'node_modules', '.bin', "ng");
|
|
15
|
+
const ngBuildProcess = spawnSync(ngPath, ngBuildArgs, {stdio: 'inherit', shell: true});
|
|
16
|
+
|
|
17
|
+
if (ngBuildProcess.status === 0) {
|
|
18
|
+
console.log('ng build completed successfully!');
|
|
19
|
+
} else {
|
|
20
|
+
// TODO: JS heap out of memory error handling
|
|
21
|
+
console.error('Error during ng build:', ngBuildProcess.error || ngBuildProcess.stderr);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ngPostBuildArgs = ['build-scripts/post-build.js', ...args];
|
|
26
|
+
console.log("Post build params - ", ngPostBuildArgs);
|
|
27
|
+
|
|
28
|
+
const ngPostBuildProcess = spawnSync('node', ngPostBuildArgs, { stdio: 'inherit' });
|
|
29
|
+
|
|
30
|
+
if (ngPostBuildProcess.status === 0) {
|
|
31
|
+
console.log('ng post build completed successfully!');
|
|
32
|
+
} else {
|
|
33
|
+
console.error('Error during ng build:', ngPostBuildProcess.error || ngPostBuildProcess.stderr);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const node_path = require('path');
|
|
4
|
+
|
|
5
|
+
const validScript = (path,indexHtml)=>{
|
|
6
|
+
return !indexHtml.includes(path);
|
|
7
|
+
}
|
|
8
|
+
const getScriptTag = (path)=>{
|
|
9
|
+
return `<script src="ng-bundle/${path}"></script>`
|
|
10
|
+
}
|
|
11
|
+
module.exports = (targetOptions, indexHtml) =>{
|
|
12
|
+
const vendor_path = node_path.resolve(__dirname+`/../dist/ng-bundle`);
|
|
13
|
+
let vendorScripts = ``;
|
|
14
|
+
fs.readdirSync(vendor_path).forEach((file)=>{
|
|
15
|
+
if(file.indexOf('vendor-')===0){
|
|
16
|
+
if(!file.includes('.br.js') && !file.includes('.gzip.js') && validScript(file,indexHtml)){
|
|
17
|
+
vendorScripts+=getScriptTag(file);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const mainScriptStr = `<script src="ng-bundle/main`;
|
|
23
|
+
const mainIndex = indexHtml.indexOf(mainScriptStr);
|
|
24
|
+
|
|
25
|
+
return `${indexHtml.slice(0,mainIndex)}
|
|
26
|
+
${vendorScripts}
|
|
27
|
+
${indexHtml.slice(mainIndex)}`;
|
|
28
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const gulp = require("gulp");
|
|
2
|
+
const filter = require("gulp-filter");
|
|
3
|
+
const purify = require("gulp-purify-css");
|
|
4
|
+
const gzip = require("gulp-gzip");
|
|
5
|
+
const brotli = require("gulp-brotli");
|
|
6
|
+
const rename = require("gulp-rename");
|
|
7
|
+
const clean = require("gulp-clean");
|
|
8
|
+
const { series, parallel } = require("gulp");
|
|
9
|
+
|
|
10
|
+
// #1 | Optimize CSS
|
|
11
|
+
gulp.task("css", () => {
|
|
12
|
+
return gulp
|
|
13
|
+
.src("../dist/ng-bundle/*")
|
|
14
|
+
.pipe(
|
|
15
|
+
filter([
|
|
16
|
+
"**/styles.*.css",
|
|
17
|
+
"**/wm-styles.css",
|
|
18
|
+
"!**/wm-styles.*.css",
|
|
19
|
+
"!**/*.br.*",
|
|
20
|
+
"!**/*.gzip.*"
|
|
21
|
+
])
|
|
22
|
+
)
|
|
23
|
+
.pipe(
|
|
24
|
+
purify(["../dist/ng-bundle/*.js"], {
|
|
25
|
+
info: true,
|
|
26
|
+
minify: true,
|
|
27
|
+
rejected: true,
|
|
28
|
+
whitelist: []
|
|
29
|
+
})
|
|
30
|
+
)
|
|
31
|
+
.pipe(gulp.dest("../dist/test/"));
|
|
32
|
+
});
|
|
33
|
+
// # 2 | Genereate GZIP files
|
|
34
|
+
gulp.task("css-gzip", () => {
|
|
35
|
+
return gulp
|
|
36
|
+
.src("../dist/test/*")
|
|
37
|
+
.pipe(filter(["**/*.css", "!**/*.br.*", "!**/*.gzip.*"]))
|
|
38
|
+
.pipe(gzip({ append: false }))
|
|
39
|
+
.pipe(
|
|
40
|
+
rename(path => {
|
|
41
|
+
path.extname = ".gzip" + path.extname;
|
|
42
|
+
})
|
|
43
|
+
)
|
|
44
|
+
.pipe(gulp.dest("../dist/test/"));
|
|
45
|
+
});
|
|
46
|
+
// # 3 | Genereate BROTLI files
|
|
47
|
+
gulp.task("css-br", () => {
|
|
48
|
+
return gulp
|
|
49
|
+
.src("../dist/test/*")
|
|
50
|
+
.pipe(filter(["**/*.css", "!**/*.br.*", "!**/*.gzip.*"]))
|
|
51
|
+
.pipe(brotli.compress())
|
|
52
|
+
.pipe(
|
|
53
|
+
rename(path => {
|
|
54
|
+
path.extname =
|
|
55
|
+
".br" +
|
|
56
|
+
path.basename.substring(
|
|
57
|
+
path.basename.lastIndexOf("."),
|
|
58
|
+
path.basename.length
|
|
59
|
+
);
|
|
60
|
+
path.basename = path.basename.substring(
|
|
61
|
+
0,
|
|
62
|
+
path.basename.lastIndexOf(".")
|
|
63
|
+
);
|
|
64
|
+
})
|
|
65
|
+
)
|
|
66
|
+
.pipe(gulp.dest("../dist/test"));
|
|
67
|
+
});
|
|
68
|
+
// # 4 | Clear ng-build CSS
|
|
69
|
+
gulp.task("clear-ng-css", () => {
|
|
70
|
+
return gulp
|
|
71
|
+
.src("../dist/ng-bundle/*")
|
|
72
|
+
.pipe(filter(["**/styles*.css", "**/wm-styles*.css"]))
|
|
73
|
+
.pipe(clean({ force: true }));
|
|
74
|
+
});
|
|
75
|
+
// # 5 | Copy optimized CSS
|
|
76
|
+
gulp.task("copy-op-css", () => {
|
|
77
|
+
return gulp.src("../dist/test/*").pipe(gulp.dest("../dist/ng-bundle/"));
|
|
78
|
+
});
|
|
79
|
+
// #6 | Clear temp folder
|
|
80
|
+
gulp.task("clear-test", () => {
|
|
81
|
+
return gulp
|
|
82
|
+
.src("../dist/test/", { read: false })
|
|
83
|
+
.pipe(clean({ force: true }));
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
### Order of Tasks ###
|
|
88
|
+
* Add hash to the wm-styles.css
|
|
89
|
+
* Optimize the styles generated from ng build
|
|
90
|
+
* Create compressed files for optimized css
|
|
91
|
+
* Clear the angular build output css
|
|
92
|
+
* Copy the optimized css to ng-bundle folder
|
|
93
|
+
* Clear the temp folder
|
|
94
|
+
*/
|
|
95
|
+
exports.default = series(
|
|
96
|
+
"css",
|
|
97
|
+
parallel("css-gzip", "css-br"),
|
|
98
|
+
"clear-ng-css",
|
|
99
|
+
"copy-op-css",
|
|
100
|
+
"clear-test"
|
|
101
|
+
);
|