Comments (6)
Ah, doesn't return any error:
- node -v 10.15.1
- npm -v 6.7.0
- gulp -v
[16:57:52] CLI version 2.0.1
[16:57:52] Local version 4.0.0
from php-minifier.
Could you post the code of your Gulp task, please?
from php-minifier.
I've tried this:
task('compress:php__tmp->dist', done => {
src(tmp+'**/*.php', {read: false})
.pipe(phpMinify({
binary: 'C:\xampp\php\php.exe'
,silent:false
// ,mode: TransformMode.fast
// ,
// removeComments: true,
// collapseWhitespace: true
}))
.on('error', err => console.log(err))
.pipe(dest(dist));
done();
});
and this:
const {phpMinify, TransformMode} = require('@cedx/gulp-php-minify');
task('compress:php', () => src(tmp+'**/*.php', {read: false})
.pipe(phpMinify({
binary: process.platform == 'win32' ? 'C:\xampp\php\php.exe' : '/usr/bin/php',
mode: process.platform == 'win32' ? TransformMode.safe : TransformMode.fast,
silent: process.stdout.isTTY
}))
.pipe(dest(dist))
);
from php-minifier.
The second sample is better than the first : the call to done
is useless when you use the gulp.src
API.
But I have strictly no idea why the plug-in doesn't work for you (i.e. the code seems fine, except for the Windows binary that should be C:\\xampp\\php\\php.exe
=> notice how the slashes are doubled).
I need more info... What is the value of tmp
and dist
variables ?
from php-minifier.
If I remove the double slash gulp return:
c:\Users......\gulpfile.js:34
binary: process.platform == 'win32' ? 'C:\xampp\php\php.exe' : '/usr/bin/php',
^^^^
SyntaxError: Invalid hexadecimal escape sequence
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
tmp and dist are variables that indicate the directory.
I've use this plugin without gulp, using a single javascript using via node.js and work well. I think is gulp the problem.
from php-minifier.
I also think it comes from the way the Gulp task is coded (although your example seems quite correct).
If it came from the plugin, either we would get an error, or the destination files would not be created. But in any case, we can't have the same content before and after applying the plugin.
I close this ticket unless you have other tracks to explore.
from php-minifier.
Related Issues (20)
- UnhandledPromiseRejectionWarning HOT 5
- Doesn't minify php files HOT 1
- Error on `require` when using Node.js pre-7.6 HOT 2
- Error: [@cedx/gulp-php-minify] promisify is not a function HOT 1
- async close() issue HOT 5
- Cannot find module '@cedx/enum' HOT 2
- PHP minify is not working HOT 1
- Error when spawning a custom PHP executable: ENOENT HOT 18
- Task Doesn't Seem to Complete HOT 2
- SyntaxError: Unexpected token HOT 1
- All Resources Links Dead HOT 1
- SyntaxError: Unexpected token { HOT 3
- Plugin not working in pure ESM environment: `__dirname` is not defined HOT 1
- Import Problem HOT 5
- Task never defined: default HOT 1
- Documentation website not working HOT 1
- ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING HOT 1
- Struggling with CommonJS Implementation HOT 3
- Parse error, file error /node_modules/@cedx/php-minifier/www/index.php HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-minifier.