-
Notifications
You must be signed in to change notification settings - Fork 41
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
Doesn't preprocess #22
Comments
That is not the correct syntax for the directives. <!-- @if ENV='dev' -->
foo
<!-- @endif --> or conditional comment syntax <!-- @if ENV='rel' !>
foo
<!-- @endif --> This task also delegates to preprocess, so if you find this is still a problem, please open an issue there. |
I fixed the syntax but I'm still hitting an issue on this, doing a ENV=rel grunt preprocess produces expected output but a ENV=rel grunt with preprocess in default taskset does not. grunt.registerTask('build', ['preprocess', 'coffee', 'less']) |
Isolate the preprocess in the default list to make sure that works with |
Nothing I can see and preprocess in default taskset does the same thing the env var ENV isn't being passed or is overwritten if invoked via grunt default vs grunt preprocess
|
Just double checked on my machine and all looks well, posting to confirm. [joverson@joverson-riot:~/temp/pp]
[10:01:44] $ ENV=dev grunt && cat done.html
Running "preprocess:main" (preprocess) task
Done, without errors.
HTML START
----------
Only shows if dev
----------
[joverson@joverson-riot:~/temp/pp]
[10:01:47] $ ENV=rel grunt && cat done.html
Running "preprocess:main" (preprocess) task
Done, without errors.
HTML START
----------
Only shows if rel
----------
[joverson@joverson-riot:~/temp/pp]
[10:01:52] $ ENV=dev grunt preprocess && cat done.html
Running "preprocess:main" (preprocess) task
Done, without errors.
HTML START
----------
Only shows if dev
----------
[joverson@joverson-riot:~/temp/pp]
[10:01:59] $ ENV=rel grunt preprocess && cat done.html
Running "preprocess:main" (preprocess) task
Done, without errors.
HTML START
----------
Only shows if rel
---------- Gruntfile : module.exports = function(grunt) {
grunt.initConfig({
preprocess : {
main : { src : 'index.html', dest : 'done.html' }
}
});
grunt.loadNpmTasks('grunt-preprocess')
grunt.registerTask('default', ['preprocess']);
}; index.html HTML START
----------
<!-- @if ENV='dev' -->
Only shows if dev
<!-- @endif -->
<!-- @if ENV='rel' !>
Only shows if rel
<!-- @endif -->
---------- If you find out the issue, please update the ticket. There's not much I can do to troubleshoot from my end. I'd recommend limiting as much as possible to isolate the variables and then testing configurations to find out what is broken. |
grep version node_modules/grunt-preprocess/package.json
"version": "3.0.1",
grep @if source/client/index.html
<!-- @if ENV='dev'>
<!-- @if ENV='rel'>
<!-- @if ENV='dev'>
<!-- @if ENV='rel'
grep -A 8 preprocess: Gruntfile.coffee
preprocess:
source:
files: [
expand: true
cwd: "#{config.hierarchy.source}"
src: '*/.html'
dest: "#{config.hierarchy.build}"
filter: 'isFile'
]
ENV='rel' grunt preprocess
Running "preprocess:source" (preprocess) task
Done, without errors.
grep "@if ENV='rel'" build/client/index.html
<!-- @if ENV='rel'>
<!-- @if ENV='rel'>
The text was updated successfully, but these errors were encountered: