-
Notifications
You must be signed in to change notification settings - Fork 12
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
Windows Support / export FilterError #11
Comments
Hi, I need to know if this issue will be solved, I have the same problem with the es6compiles in windows. |
same here |
Sorry, it's been awhile since I visited my project last time. Too much work to do on my job.
I have designed it to work on any platform where the underlying Node libraries work (I mean But I have tested it only on Linux / macOS :) Indeed, the problem is in the COMPRESS_ES6_COMPILER_CMD = 'export NODE_PATH="{paths}" && '
'{browserify_bin} "{infile}" -o "{outfile}" '
'-t [ "{node_modules}/babelify" --presets="{node_modules}/babel-preset-es2015" ]' I'm not very familiar with Windows CMD way of setting the If you will figure it out - just set your custom Django setting: # settings.py
COMPRESS_ES6_COMPILER_CMD = '<set the NODE_PATH env var to {paths} somehow and call> '
'{browserify_bin} "{infile}" -o "{outfile}" '
'-t [ "{node_modules}/babelify" --presets="{node_modules}/babel-preset-es2015" ]' If it's not possible through the CMD then it should be possible from Python:
But this would require a pull-request to this project. And I'm really sorry but I'm still very busy at my main job, so I appreciate your help with the pull-request ;) |
I am trying to get this to work on windows. This is as close as i got settings.py COMPRESS_ES6_COMPILER_CMD = '$env:NODE_PATH="{paths}" && {browserify_bin} "{infile}" -o "{outfile}" -t [ "{node_modules}/babelify" --presets ["{node_modules}/@babel/preset-env"] ]' (untitledgame) PS C:\Projects\untitledgame> python manage.py compress
CommandError: An error occurred during rendering game\index.html: The filename, directory name, or volume label syntax is incorrect.
Compressing... game\index.html {% compress js %}
{% include "game/parts/scripts_libs.html" %}
{% endcompress %}
{% compress js %}
{% include "game/parts/scripts_game.html" %}
<script src="{{ STATIC_URL }}custom/js/main-common.js" type="module"></script>
<script src="{{ STATIC_URL }}custom/js/main-game.js" type="module"></script>
{% endcompress %} I have verified browserify and babel actually works by running a command directly. This command works:
|
if os.name == 'nt':
COMPRESS_ES6_COMPILER_CMD = 'set NODE_PATH="{paths}" && {browserify_bin} "{infile}" -o "{outfile}" -t [ "{node_modules}\\babelify" --presets="{node_modules}\\babel-preset-es2015"]'
COMPRESS_BROWSERIFY_BIN = 'node_modules\\.bin\\browserify' This gets past an initial error, however ended up with a EPERM rename error, which seems to be related to the TemporaryNamedFile, using an absolute output file path avoids this, however Django can still not properly run the code |
In Windows 10 environment a FilterError(err) in raised: "compressor.exception.FilterError: 'export' is not recognized".
Regarding the issue and answer here: https://stackoverflow.com/questions/55029689/use-django-compressor-es6compiler-under-windows - is Windows supported at all? If so, what cofigurations / adjustments are missing?
Thank you.
The text was updated successfully, but these errors were encountered: