AB#5820 - Copy client files into both netcore and framework executables
This commit is contained in:
@@ -71,7 +71,8 @@ module.exports = {
|
||||
assets: "./src/assets/**"
|
||||
}
|
||||
},
|
||||
root: "../Umbraco.Web.UI/",
|
||||
root: "../Umbraco.Web.UI.NetCore/wwwroot/",
|
||||
roots: ["../Umbraco.Web.UI/", "../Umbraco.Web.UI.NetCore/wwwroot/"],
|
||||
targets: {
|
||||
js: "Umbraco/js/",
|
||||
lib: "Umbraco/lib/",
|
||||
|
||||
@@ -6,6 +6,7 @@ var gulp = require('gulp');
|
||||
var MergeStream = require('merge-stream');
|
||||
|
||||
var imagemin = require('gulp-imagemin');
|
||||
var _ = require('lodash');
|
||||
|
||||
/**************************
|
||||
* Task processes and copies all dependencies, either installed by npm or stored locally in the project
|
||||
@@ -242,18 +243,23 @@ function dependencies() {
|
||||
|
||||
// add streams for node modules
|
||||
nodeModules.forEach(module => {
|
||||
stream.add(
|
||||
gulp.src(module.src,
|
||||
{ base: module.base, allowEmpty: true })
|
||||
.pipe(gulp.dest(config.root + config.targets.lib + "/" + module.name))
|
||||
);
|
||||
var task = gulp.src(module.src, { base: module.base, allowEmpty: true });
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
task = task.pipe(gulp.dest(root + config.targets.lib + "/" + module.name))
|
||||
});
|
||||
|
||||
stream.add(task);
|
||||
});
|
||||
|
||||
//copy over libs which are not on npm (/lib)
|
||||
stream.add(
|
||||
gulp.src(config.sources.globs.lib, { allowEmpty: true })
|
||||
.pipe(gulp.dest(config.root + config.targets.lib))
|
||||
);
|
||||
var libTask = gulp.src(config.sources.globs.lib, { allowEmpty: true });
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
libTask = libTask.pipe(gulp.dest(root + config.targets.lib))
|
||||
});
|
||||
|
||||
stream.add(libTask);
|
||||
|
||||
//Copies all static assets into /root / assets folder
|
||||
//css, fonts and image files
|
||||
@@ -270,28 +276,38 @@ function dependencies() {
|
||||
]
|
||||
})
|
||||
]));
|
||||
|
||||
assetsTask = assetsTask.pipe(gulp.dest(config.root + config.targets.assets));
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
assetsTask = assetsTask.pipe(gulp.dest(root + config.targets.assets));
|
||||
});
|
||||
|
||||
|
||||
stream.add(assetsTask);
|
||||
|
||||
// Copies all the less files related to the preview into their folder
|
||||
//these are not pre-processed as preview has its own less compiler client side
|
||||
stream.add(
|
||||
gulp.src("src/canvasdesigner/editors/*.less", { allowEmpty: true })
|
||||
.pipe(gulp.dest(config.root + config.targets.assets + "/less"))
|
||||
);
|
||||
var lessTask = gulp.src("src/canvasdesigner/editors/*.less", { allowEmpty: true });
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
lessTask = lessTask.pipe(gulp.dest(root + config.targets.assets + "/less"));
|
||||
});
|
||||
stream.add(lessTask);
|
||||
|
||||
|
||||
|
||||
// TODO: check if we need these fileSize
|
||||
stream.add(
|
||||
gulp.src("src/views/propertyeditors/grid/config/*.*", { allowEmpty: true })
|
||||
.pipe(gulp.dest(config.root + config.targets.views + "/propertyeditors/grid/config"))
|
||||
);
|
||||
stream.add(
|
||||
gulp.src("src/views/dashboard/default/*.jpg", { allowEmpty: true })
|
||||
.pipe(gulp.dest(config.root + config.targets.views + "/dashboard/default"))
|
||||
);
|
||||
|
||||
var configTask = gulp.src("src/views/propertyeditors/grid/config/*.*", { allowEmpty: true });
|
||||
_.forEach(config.roots, function(root){
|
||||
configTask = configTask.pipe(gulp.dest(root + config.targets.views + "/propertyeditors/grid/config"));
|
||||
});
|
||||
stream.add(configTask);
|
||||
|
||||
var dashboardTask = gulp.src("src/views/dashboard/default/*.jpg", { allowEmpty: true });
|
||||
_.forEach(config.roots, function(root){
|
||||
dashboardTask = dashboardTask .pipe(gulp.dest(root + config.targets.views + "/dashboard/default"));
|
||||
});
|
||||
stream.add(dashboardTask);
|
||||
|
||||
return stream;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,10 +16,12 @@ function js() {
|
||||
//we run multiple streams, so merge them all together
|
||||
var stream = new MergeStream();
|
||||
|
||||
stream.add(
|
||||
gulp.src(config.sources.globs.js).pipe( gulp.dest(config.root + config.targets.js) )
|
||||
);
|
||||
|
||||
var task = gulp.src(config.sources.globs.js);
|
||||
_.forEach(config.roots, function(root){
|
||||
task = task.pipe( gulp.dest(root + config.targets.js) )
|
||||
})
|
||||
stream.add(task);
|
||||
|
||||
_.forEach(config.sources.js, function (group) {
|
||||
stream.add(
|
||||
processJs(group.files, group.out)
|
||||
|
||||
@@ -12,12 +12,16 @@ function views() {
|
||||
|
||||
_.forEach(config.sources.views, function (group) {
|
||||
|
||||
console.log("copying " + group.files + " to " + config.root + config.targets.views + group.folder)
|
||||
|
||||
|
||||
stream.add (
|
||||
gulp.src(group.files)
|
||||
.pipe( gulp.dest(config.root + config.targets.views + group.folder) )
|
||||
);
|
||||
var task = gulp.src(group.files);
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
console.log("copying " + group.files + " to " + root + config.targets.views + group.folder)
|
||||
task = task.pipe( gulp.dest(root + config.targets.views + group.folder));
|
||||
})
|
||||
|
||||
stream.add (task);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -37,8 +37,13 @@ function watchTask(cb) {
|
||||
if(group.watch !== false) {
|
||||
viewWatcher = watch(group.files, { ignoreInitial: true, interval: watchInterval });
|
||||
viewWatcher.on('change', function(path, stats) {
|
||||
console.log("copying " + group.files + " to " + config.root + config.targets.views + group.folder);
|
||||
src(group.files).pipe( dest(config.root + config.targets.views + group.folder) );
|
||||
|
||||
var task = src(group.files);
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
console.log("copying " + group.files + " to " + root + config.targets.views + group.folder);
|
||||
task = task.pipe( dest(root + config.targets.views + group.folder) );
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,11 +8,14 @@ var sort = require('gulp-sort');
|
||||
var concat = require('gulp-concat');
|
||||
var wrap = require("gulp-wrap-js");
|
||||
var embedTemplates = require('gulp-angular-embed-templates');
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = function (files, out) {
|
||||
|
||||
console.log("JS: ", files, " -> ", config.root + config.targets.js + out)
|
||||
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
console.log("JS: ", files, " -> ", root + config.targets.js + out)
|
||||
})
|
||||
|
||||
var task = gulp.src(files);
|
||||
|
||||
// check for js errors
|
||||
@@ -27,9 +30,12 @@ module.exports = function (files, out) {
|
||||
//in production, embed the templates
|
||||
task = task.pipe(embedTemplates({ basePath: "./src/", minimize: { loose: true } }))
|
||||
|
||||
task = task.pipe(concat(out))
|
||||
.pipe(wrap('(function(){\n%= body %\n})();'))
|
||||
.pipe(gulp.dest(config.root + config.targets.js));
|
||||
task = task.pipe(concat(out)).pipe(wrap('(function(){\n%= body %\n})();'))
|
||||
|
||||
_.forEach(config.roots, function(root){
|
||||
task = task.pipe(gulp.dest(root + config.targets.js));
|
||||
})
|
||||
|
||||
|
||||
|
||||
return task;
|
||||
|
||||
@@ -9,6 +9,7 @@ var cssnano = require('cssnano');
|
||||
var cleanCss = require('gulp-clean-css');
|
||||
var rename = require('gulp-rename');
|
||||
var sourcemaps = require('gulp-sourcemaps');
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = function(files, out) {
|
||||
|
||||
@@ -16,8 +17,10 @@ module.exports = function(files, out) {
|
||||
autoprefixer,
|
||||
cssnano({zindex: false})
|
||||
];
|
||||
|
||||
console.log("LESS: ", files, " -> ", config.root + config.targets.css + out)
|
||||
_.forEach(config.roots, function(root){
|
||||
console.log("LESS: ", files, " -> ", root + config.targets.css + out);
|
||||
})
|
||||
|
||||
|
||||
var task = gulp.src(files);
|
||||
|
||||
@@ -34,7 +37,12 @@ module.exports = function(files, out) {
|
||||
task = task.pipe(sourcemaps.write('./maps'));
|
||||
}
|
||||
|
||||
task = task.pipe(gulp.dest(config.root + config.targets.css));
|
||||
_.forEach(config.roots, function(root){
|
||||
task = task.pipe(gulp.dest(root + config.targets.css));
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
return task;
|
||||
|
||||
|
||||
@@ -15,23 +15,23 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Umbraco\**" />
|
||||
<Compile Remove="wwwroot\Umbraco\**" />
|
||||
<Compile Remove="App_Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Remove="Umbraco\**" />
|
||||
<EmbeddedResource Remove="wwwroot\Umbraco\**" />
|
||||
<EmbeddedResource Remove="App_Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Umbraco\**" />
|
||||
<None Remove="wwwroot\Umbraco\**" />
|
||||
<None Remove="App_Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Umbraco\**" />
|
||||
<Content Remove="wwwroot\Umbraco\**" />
|
||||
<Content Remove="wwwroot\Umbraco\**" />
|
||||
<Content Remove="App_Data\**" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user