We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Configuration:
{ gzip: true, minifier: function ( contents, filepath ) { if ( filepath.match( /\.min\./g ) ) { return contents } var file_extension = ''; var minified_filename = filepath.replace( /\.(js|css)$/, function(match, extension ) { file_extension = extension; return '.min.' + extension; } ); // re-construct a path like: /path/to/assets/js/main.min.js var minified_path = path.join( '/path/to/assets/', file_extension, minified_filename ); if ( fs.existsSync( minified_path ) ) { return fs.readFileSync( minified_path ); } return ''; } }
Since the filepath only contains the filename I had to hardcode the full path which is not ideal.
To the best of my knowledge I don't think there are other ways to get the full path rather than hardcoding it in this case.
Having access to the full path will prevent us having to hardcode the path on every project.
Optionally we could add the full path as a third argument for backward-compatibility.
Thanks ;-)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Configuration:
Since the filepath only contains the filename I had to hardcode the full path which is not ideal.
To the best of my knowledge I don't think there are other ways to get the full path rather than hardcoding it in this case.
Having access to the full path will prevent us having to hardcode the path on every project.
Optionally we could add the full path as a third argument for backward-compatibility.
Thanks ;-)
The text was updated successfully, but these errors were encountered: