Comments (4)
The easiest way to do it is using custom tasks in ./build/tasks
folder.
Custom task's file is a .js file with any name in that folder and a specific pattern.
This can be a good point to start with:
module.exports = (gulp, $) => {
gulp.task('push-html', [ 'config' ], () => {
let configs = global.gulpConfigs;
return gulp
.src([ './dist/**/*.html' ], { base: configs.watch.base })
.pipe($.spsave(configs.spSaveCoreOptions, configs.privateConf.creds));
});
gulp.task('watch-html', [ 'config' ], () => {
let configs = global.gulpConfigs;
$.watch([ './dist/**/*.html' ], (event) => {
console.log(event.path);
gulp.src(event.path, {
base: configs.watch.base
}).pipe(
$.spsave(
configs.spSaveCoreOptions,
configs.privateConf.creds
)
);
});
});
};
from sp-build-tasks.
Hey @AbouJalal,
Thank you for your feedback!
Watch and publish tasks grab all files with **/*.*
pattern, so everything in dlRootFolder
(by default it's ./dist
folder) publishes to SharePoint.
I'm wondering what is your use case?
from sp-build-tasks.
I want to push all templates that i have in my display templates library.
I can't push all the files that are in my dist because i have a js file associated with each html file.
Usually, SP will create and associate the js file automatically.
No need for some kind of a workaround as i already have couple of workarounds.
I just want to know if there is a way to teach gulp to push only the html files?
from sp-build-tasks.
Closing this. Feel free to reopen if you still have questions.
from sp-build-tasks.
Related Issues (15)
- Rethink settings layer for masterpages and layouts
- Add watching for files presented in copy rules in watch tasks HOT 2
- Build fails is no default style file exists
- SCSS conversion for all files HOT 3
- Change stream for errors HOT 1
- Build fails is no `./build/tasks` folder exists
- TypeScript issue when using @types/gulp 4.0.4 definition HOT 1
- Add schema to ./config/app.json HOT 2
- Gulp build --prod --webpack error HOT 2
- Include all script/components style files (scss/css) in build bundle.
- fileName is not passed to handlebars templates HOT 1
- Please update es5-ext dependency to avoid spreading political agenda HOT 2
- Add multiple entry point for webpack configuration HOT 2
- Automate ES6 and vanilla JS usage scanarios HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sp-build-tasks.