cr0ybot / gulp-wp

A reusable, extendable, updatable Gulp workflow for WordPress themes & plugins
MIT License
26 stars 3 forks source link

Scripts task doesn't output files with relative path #52

Closed cr0ybot closed 1 year ago

cr0ybot commented 1 year ago

The styles task is currently set up to output CSS files with paths relative to the srcBase. If a project customizes styles.entries to include a deeper glob path, it just works, for example:

module.exports = {
    tasks: {
        scripts: {
            entries: [ 'src/scripts/*.*', 'src/scripts/blocks/*/*/*.*' ],
        },
        styles: {
            entries: [ 'src/styles/*.*', 'src/styles/blocks/*/*.*' ],
        },
    },
};

Here, the styles at src/styles/blocks/core/foo.scss are output to dist/css/blocks/core/foo.css as expected, but the script at src/scripts/blocks/core/foo/script.js is output as dist/js/script.js, potentially interfering with a file located at src/js/script.js.