0

sxa watch All -d AND gulp, only track css. It says its watching js and scriban but when I save a js or scriban, CLI does not throw a response. Am I missing something ?

This is my config:

Sass (working)

sass: {
        root: 'sass/**/*.scss',
        components: {
            sassPath: 'sass/*.scss',
            stylePath: 'styles'
        },
        styles: {
            sassPath: [
                'sass/styles/common/*.scss',
                'sass/styles/add-highlight/*.scss',
                'sass/styles/background-colors/*.scss',
                'sass/styles/content-alignment/*.scss',
                'sass/styles/layout/*.scss',
                'sass/styles/spacing/*.scss'
            ],
            stylePath: 'styles',
            concatName: 'styles.css'
        }, 

JS (working), it was not working before but now its working as I did a sxa rebuild. after that now its working

     js: {
            path: 'scripts/**/*.js',
            esLintUploadOnError: true,
            minificationPath: ['scripts/**/*.js'],
            jsOptimiserFilePath: 'scripts/**/',
            jsOptimiserFileName: 'pre-optimized-min.js',
            es6Support: true,
            jsSourceMap: false,
            enableMinification: true,
            disableSourceUploading: true
        },

Scriban, Not working. ** issue is with scriban only.

scriban: {
        path: (function () {
            if (!global.rootPath) return;

            let rootCreativeExchangePath = global.rootPath.split('-\\media'),
                _path = './';
            if (rootCreativeExchangePath.length > 1) {
                _path = _path + path.relative('./', global.rootPath.split('-\\media')[0]).split(path.sep).join('/')
            }
            return _path + '/-/scriban/**/*.scriban';
        })(),

Scriban confiuration file:

{"siteId":"{F860FD06-F351-411F-B329-562D41B9941C}","database":"sc93_EXM.Master"}  

This is the theme file structure: enter image description here

2
  • Hey there, welcome, Love to help out but we're gonna need a lot more information, like what is your config set too? How are your files structured? have you used --debug and looked at the output? What have you tried?
    – Richard Seal
    Commented Nov 3, 2021 at 23:29
  • Hi I have modified the question with config and file structure. I hope this is sufficient. Please let me know Commented Nov 4, 2021 at 1:11

1 Answer 1

2

Your config doesn't match your path for the scriban templates. You have:

return _path + '/-/scriban/**/*.scriban';

if you look at your folder structure you don't have a folder named - before the scriban folder.

Change your path to this:

return _path + '/scriban/**/*.scriban';

and it should pick up your files.

2
  • I did that as well. Still same thing. Does not work ....I tried adding a DASH folder and remove it as well. both way didnt work Commented Nov 4, 2021 at 20:27
  • issue was I had to remove first / from the path .... so correct method was return _path + '-/scriban/**/*.scriban'; Commented Nov 5, 2021 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.