Code Monkey home page Code Monkey logo

Comments (4)

koltyakov avatar koltyakov commented on June 3, 2024 2

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.

koltyakov avatar koltyakov commented on June 3, 2024

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.

AbouJalal avatar AbouJalal commented on June 3, 2024

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.

koltyakov avatar koltyakov commented on June 3, 2024

Closing this. Feel free to reopen if you still have questions.

from sp-build-tasks.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.