Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token { #14

Closed
ronaldoscotti opened this issue Aug 8, 2019 · 3 comments
Closed

SyntaxError: Unexpected token { #14

ronaldoscotti opened this issue Aug 8, 2019 · 3 comments
Assignees

Comments

@ronaldoscotti
Copy link

Hello!

I'm getting this error when running the gulp task:

Screenshot_1

I'm using npm v6.10.3 and node v12.8.0. I'm also using babel.

Can someone give me a light on how to solve this?

This is my code:

import {src, dest, watch, series, parallel} from 'gulp';
import {phpMinify} from "@cedx/gulp-php-minify";

export const php = () => {
    return src("includes/**/*.php", {read: false})
        .pipe(phpMinify())
        .pipe(dest('inc'));
};

I've also tried using this approach, but got the same error:

import gulp from 'gulp';
import {phpMinify} from "@cedx/gulp-php-minify";

gulp.task('compress:php', () => gulp.src('includes/**/*.php', {read: false})
    .pipe(phpMinify())
    .pipe(gulp.dest('inc'))
);
@cedx
Copy link
Owner

cedx commented Aug 8, 2019

This is an expected error since version 10.x: this plugin is now packaged as ES modules.
You must either continue to use version 9.x or convert your Gulp script to this new module format.
More info on the upgrade path here: https://dev.belin.io/gulp-php-minify/esm/

@cedx cedx self-assigned this Aug 8, 2019
@ronaldoscotti
Copy link
Author

Using the version 9.3.0 of the package solved the issue.

Thanks for the support!

@danielleevandenboschtand

This is an expected error since version 10.x: this plugin is now packaged as ES modules.
You must either continue to use version 9.x or convert your Gulp script to this new module format.
More info on the upgrade path here: https://dev.belin.io/gulp-php-minify/esm/

You must either continue to use version 9.x or convert your Gulp script to this new module format.

I have hunted high and low and am kinda new to the gulp thing. what would a converted script look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants