Closed Stanzilla closed 4 years ago
Generally you can include any of the imagemin plugins and rebuild the app.
@DanielRuf yeah I was put off a bit because that repo was updated so long ago. Does your fork still use old atom-shell or Electron now?
It uses the latest Electron version.
@DanielRuf Neat! I tried to compile it but it always fails with:
λ npm run build
> imagemin-app@1.0.0 build C:\Users\Benjamin\VCS\Git\imagemin-app
> mkdir build | npm run build-index-js | npm run build-index-js
A subdirectory or file build already exists.
> imagemin-app@1.0.0 build-index-js C:\Users\Benjamin\VCS\Git\imagemin-app
> duo index.js | uglifyjs > build/index.js
The process cannot access the file because it is being used by another process.
building : index.js
using : compatibility
using : stoj
building : index.js
using : compatibility
using : stoj
events.js:136
throw er; // Unhandled 'error' event
^
OpenError: IO error: LockFile C:\Users\Benjamin\VCS\Git\imagemin-app\components\duo-cache/LOCK: The process cannot access the file because it is being used by another process.
at C:\Users\Benjamin\VCS\Git\imagemin-app\node_modules\levelup\lib\levelup.js:117:34
at C:\Users\Benjamin\VCS\Git\imagemin-app\node_modules\abstract-leveldown\abstract-leveldown.js:39:16
built : index.js
npm error : Error: EBUSY: resource busy or locked, open 'C:\Users\Benjamin\VCS\Git\imagemin-app\build\index.js'
ERR!
code ELIFECYCLE
npm ERR! errno 1
npm ERR! imagemin-app@1.0.0 build-index-js: `duo index.js | uglifyjs > build/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the imagemin-app@1.0.0 build-index-js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Benjamin\AppData\Roaming\npm-cache\_logs\2017-12-04T13_33_24_084Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Benjamin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build-index-js' ]
2 info using npm@5.6.0
3 info using node@v9.2.0
4 verbose run-script [ 'prebuild-index-js', 'build-index-js', 'postbuild-index-js' ]
5 info lifecycle imagemin-app@1.0.0~prebuild-index-js: imagemin-app@1.0.0
6 info lifecycle imagemin-app@1.0.0~build-index-js: imagemin-app@1.0.0
7 verbose lifecycle imagemin-app@1.0.0~build-index-js: unsafe-perm in lifecycle true
8 verbose lifecycle imagemin-app@1.0.0~build-index-js: PATH: C:\Users\Benjamin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Benjamin\VCS\Git\imagemin-app\node_modules\.bin;C:\Users\Benjamin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Benjamin\VCS\Git\imagemin-app\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\ProgramData\ComposerSetup\bin;C:\Users\Benjamin\AppData\Roaming\Composer\vendor\bin;C:\xampp\php;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\MSBuild\15.0\Bin;C:\Software\Android\sdk\platform-tools;C:\Program Files (x86)\LuaRocks;C:\Program Files (x86)\Lua\5.1\\systree\bin;C:\Software\Sublime Text;C:\Software\WinSCP;C:\Program Files\7-Zip;C:\Lua\5.1;C:\Lua\5.1\clibs;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin;C:\ProgramData\chocolatey\bin;C:\HashiCorp\Vagrant\bin;K:\Tools\Sysinternals\;C:\Users\Benjamin\AppData\Local\Atlassian\SourceTree\git_local\mingw64\bin;C:\Program Files\TortoiseSVN\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Git\cmd;C:\Users\Benjamin\AppData\Local\scoop\apps\ruby\current\gems\bin;C:\Users\Benjamin\AppData\Local\scoop\apps\ruby\current\bin;C:\Users\Benjamin\appdata\local\scoop\shims;c:\Users\Benjamin\AppData\Local\atom\bin;C:\Program Files (x86)\Lua\5.1\;C:\Program Files (x86)\LuaRocks;C:\Users\Benjamin\AppData\Roaming\LuaRocks\bin;C:\Users\Benjamin\AppData\Local\atom\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\Benjamin\AppData\Local\Programs\Fiddler;C:\Users\Benjamin\AppData\Local\Microsoft\WindowsApps;C:\Users\Benjamin\AppData\Roaming\npm
9 verbose lifecycle imagemin-app@1.0.0~build-index-js: CWD: C:\Users\Benjamin\VCS\Git\imagemin-app
10 silly lifecycle imagemin-app@1.0.0~build-index-js: Args: [ '/d /s /c', 'duo index.js | uglifyjs > build/index.js' ]
11 silly lifecycle imagemin-app@1.0.0~build-index-js: Returned: code: 1 signal: null
12 info lifecycle imagemin-app@1.0.0~build-index-js: Failed to exec build-index-js script
13 verbose stack Error: imagemin-app@1.0.0 build-index-js: `duo index.js | uglifyjs > build/index.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:159:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Benjamin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:159:13)
13 verbose stack at maybeClose (internal/child_process.js:943:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid imagemin-app@1.0.0
15 verbose cwd C:\Users\Benjamin\VCS\Git\imagemin-app
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Benjamin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build-index-js"
18 verbose node v9.2.0
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error imagemin-app@1.0.0 build-index-js: `duo index.js | uglifyjs > build/index.js`
22 error Exit status 1
23 error Failed at the imagemin-app@1.0.0 build-index-js script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
You have to do it step by step. Also there is already a release in the release directory. I ran each subtask and their subtasks one after another.
@DanielRuf Yeah I was trying to integrate Guetzli so I had to rebuild. And the problem is it already fails at the first command, npm run start
:/ The file locking seems to be a general problem, it actually happens in every step
You have to run duo, myth and so on separately. The npm scripts so far do not work like this yet.
I see. Will try that. Did you see the next
branch though? Maybe that's a more modern starting point anyway? Most of the components used are not maintained :/
I am currently planning to move to this branch in the next release.
Yeah I'll give up for now and wait for that next release :)
these are the steps that are needed:
duo index.js
uglifyjs build/index.js -o build/index.js",
duo index.css
myth build/index.css build/index.css
cleancss build/index.css -o build/index.css
These were the commands that I ran as far as I remember, I've done this in the middle of the night.
Piping does not work on Windows.
I have created new npm scripts which also work on Windows.
https://github.com/DanielRuf/imagemin-app
The next version uses JSX, React and a few other things (asyc / wait and so on).
Is the other version also needed? PS: Watch this space: https://github.com/DanielRuf/imagemin-app-prebuilt
That works very well. I was also able to add the zopfli and guetzli plugins and they seem to work. great job!
Cool =) I try to get a working production build of the next version. Currently only the packaging process does not add all dependencies but so far it works too.
Any plans to include a few more plugins like webp or guetzli?