Skip to content

Suggest about options #128

Open
Open

Description

@gucong3000

The options are becoming more and more complex so that the documents describing it are long. Can we make it compatible with postcss-load-config
See: https://github.com/gucong3000/gulp-postcss#readme

Activity

  1. gucong3000 commented on Jul 6, 2017

    @gucong3000
    Author
    gulp.task('css', function () {
        function callback(ctx) {
            return {
                // Configure parser on per-file-basis.
                parser: ctx.file.extname === '.sss' ? 'sugarss' : false,
                // Plugins can be loaded in either using an {Object} or an {Array}.
                plugins: [
                    autoprefixer,
                    cssnano
                ]
            };
        }
        return gulp.src('./src/*.css', {
            // Source map support
            sourcemaps: true
        })
            .pipe(postcss(callback))
            // Message repport support
            .pipe(reporter())
            .pipe(gulp.dest('./dest'));
    });

    In this demo callback function as same as postcss-load-config
    image

  2. gucong3000 commented on Jul 6, 2017

    @gucong3000
    Author

    Config in postcss.config.js or .postcssrc.js, is not same with gulp-postcss at all.
    In my fork, they are the same data structures and APIs

  3. gucong3000 commented on Jul 6, 2017

    @gucong3000
    Author

    So that users can learn one of them, do not have to pay twice times the cost of learning

  4. w0rm commented on Jul 6, 2017

    @w0rm
    Member

    I see, this is not about changing the docs, but about changing the api. Can't you achieve the same thing with postcss.config.js, why does it have to be inlined? The idea is to only support postcss-load-config when there are no options passed to gulp-postcss. If the options are passed, then postcss-load-config is not even required.

  5. gucong3000 commented on Jul 6, 2017

    @gucong3000
    Author

    why does it have to be inlined?

    In our company, we use postcss under webpack, gulp-postcss use for run stylelint and stylefmt.
    So, config in postcss.config.js are css build logic, style lint and fix are write in gulpfile.js.

    If the two use the same syntax, it can reduce the cost of learning for the project members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions