Skip to content

Commit 6ae8050

Browse files
authored
Fix resources (#386)
1 parent 315af12 commit 6ae8050

File tree

6 files changed

+59
-37
lines changed

6 files changed

+59
-37
lines changed

gulpfile.js

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -289,46 +289,54 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
289289
target: "es5",
290290
};
291291

292-
return gulp.src(assetGroup.inputPaths)
293-
.pipe(gulpif(!doRebuild,
294-
gulpif(doConcat,
295-
newer(assetGroup.outputPath),
296-
newer({
297-
dest: assetGroup.outputDir,
298-
ext: ".js"
299-
}))))
300-
.pipe(plumber())
301-
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
302-
.pipe(gulpif("*.ts", typescript(tsCompilerOptions)))
303-
.pipe(babel({
304-
"presets": [
305-
[
306-
"@babel/preset-env",
307-
{
308-
"modules": false
309-
},
310-
"@babel/preset-flow"
292+
function createJsStream(enableSourceMaps) {
293+
return gulp.src(assetGroup.inputPaths)
294+
.pipe(gulpif(!doRebuild,
295+
gulpif(doConcat,
296+
newer(assetGroup.outputPath),
297+
newer({
298+
dest: assetGroup.outputDir,
299+
ext: ".js"
300+
}))))
301+
.pipe(plumber())
302+
.pipe(gulpif(enableSourceMaps, sourcemaps.init()))
303+
.pipe(gulpif("*.ts", typescript(tsCompilerOptions)))
304+
.pipe(babel({
305+
"presets": [
306+
[
307+
"@babel/preset-env",
308+
{
309+
"modules": false
310+
},
311+
"@babel/preset-flow"
312+
]
311313
]
312-
]
313-
}))
314-
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
315-
.pipe(header(
316-
"/*\n" +
317-
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
318-
"** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.\n" +
319-
"*/\n\n"))
314+
}))
315+
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
316+
.pipe(header(
317+
"/*\n" +
318+
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
319+
"** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp.\n" +
320+
"*/\n\n"));
321+
}
322+
323+
var devStream = createJsStream(generateSourceMaps)
320324
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
321-
.pipe(gulp.dest(assetGroup.outputDir))
322-
// Uncomment to copy assets to wwwroot
323-
//.pipe(gulp.dest(assetGroup.webroot))
325+
.pipe(gulp.dest(assetGroup.outputDir));
326+
// Uncomment to copy assets to wwwroot
327+
//.pipe(gulp.dest(assetGroup.webroot));
328+
329+
var minifiedStream = createJsStream(false)
324330
.pipe(terser())
325331
.pipe(rename({
326332
suffix: ".min"
327333
}))
328334
.pipe(eol('\n'))
329-
.pipe(gulp.dest(assetGroup.outputDir))
335+
.pipe(gulp.dest(assetGroup.outputDir));
330336
// Uncomment to copy assets to wwwroot
331337
//.pipe(gulp.dest(assetGroup.webroot));
338+
339+
return merge([devStream, minifiedStream]);
332340
}
333341

334342
function buildCopyPipeline(assetGroup, doRebuild) {

src/CrestApps.OrchardCore.Documentations/docs/changelog/v2.0.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ This is a major release that introduces new modules, an orchestrator-based archi
1313

1414
---
1515

16+
## Build and Tooling
17+
18+
- **Gulp minified JavaScript output restored** — The asset pipeline now writes the non-minified and minified JavaScript files through separate streams, which restores generated outputs such as `ai-chat.min.js` when running `gulp rebuild` or `npm run rebuild` with the current Gulp toolchain. Copy-based vendor assets such as `purify.min.js` and `chart.min.js` continue to be emitted to `wwwroot` from their manifests.
19+
20+
---
21+
1622
## New Modules
1723

1824
### AI Prompt Templates

src/CrestApps.OrchardCore.Documentations/docs/getting-started.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,25 @@ dotnet add package CrestApps.OrchardCore.AI.Chat
4646
cd CrestApps.OrchardCore
4747
```
4848

49-
3. **Build the Solution:**
49+
3. **Install Frontend Dependencies and Rebuild Assets:**
50+
```bash
51+
npm install
52+
npm run rebuild
53+
```
54+
55+
The Gulp asset pipeline emits both the standard and minified frontend outputs into each module's `wwwroot` folder, such as `ai-chat.js` and `ai-chat.min.js`.
56+
57+
4. **Build the Solution:**
5058
```bash
5159
dotnet build
5260
```
5361

54-
4. **Launch the Application:**
62+
5. **Launch the Application:**
5563
```bash
5664
dotnet run
5765
```
5866

59-
5. **Enable Modules:**
67+
6. **Enable Modules:**
6068
Access the **Orchard Core Admin Dashboard** to enable desired CrestApps modules.
6169

6270
## Package Feeds

src/Modules/CrestApps.OrchardCore.AI.Chat.Interactions/wwwroot/scripts/chat-interaction.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Modules/CrestApps.OrchardCore.AI.Chat/wwwroot/scripts/ai-chat.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Modules/CrestApps.OrchardCore.Resources/wwwroot/scripts/flatpickr-culture.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)