imba / webpack-app-imba Goto Github PK
View Code? Open in Web Editor NEWImba 2 + Webpack App Starter
Home Page: https://hello-world-imba.netlify.com
Imba 2 + Webpack App Starter
Home Page: https://hello-world-imba.netlify.com
This is interesting for learners or beginners curious why and how the example is structured.
Hello,
I'm starting to learn Imba. The client.js is 91K so I tried to plugin the minifier (UglifyJs) and it failed due to what I think was an ES6 feature it couldn't parse. I tried to plugin babel but could figure out how to get it to work (don't have needed experience with either webpack or babel). Could you please provide an example of how to minify the example?
Thank you for the time and effort in looking into this issue. :)
Setting the mode should fix the below warning.
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
I'm using win-7 64-bit. I installing imba with npm gave the follwing output:
E:\workspace\npm>npm install -g imba
npm WARN optional dep failed, continuing [email protected]
C:\Users\hrzafer\AppData\Roaming\npm\imba -> C:\Users\hrzafer\AppData\Roaming\np
m\node_modules\imba\bin\imba
[email protected] C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], escape-string-regexp@1
.0.3, [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], glob-pa
[email protected], [email protected], [email protected], [email protected], [email protected]
.0)
I think it is installed properly anyway
E:\workspace\npm>imba
Usage: undefined [options] [command]
[...]
Then I created a directory, created another called src, copied hello.imba and tried to compile:
E:\workspace\npm>imba watch ./src
dirname E:\workspace\npm E:\workspace\npm\src
--- watch dir: E:\workspace\npm\src
--- write dir: \E:\workspace\npm\lib
fs.js:747
return binding.mkdir(pathModule._makeLong(path),
^
Error: ENOENT, no such file or directory 'E:\E:.'
at Error (native)
at Object.fs.mkdirSync (fs.js:747:18)
at ensureDir (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\lib\compiler\cli.js:202:8)
at writeFile (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\lib\compiler\cli.js:333:3)
at EventEmitter.<anonymous> (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\lib\compiler\cli.js:447:12)
at EventEmitter.emit (events.js:118:17)
at EventEmitter.<anonymous> (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\node_modules\chokidar\index.js:137:38)
at EventEmitter.FSWatcher._emit (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\node_modules\chokidar\index.js:152:5)
at EventEmitter.NodeFsHandler._handleFile (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\node_modules\chokidar\lib\nodefs-handler.js:275:10)
at EventEmitter.<anonymous> (C:\Users\hrzafer\AppData\Roaming\npm\node_modules\imba\node_modules\chokidar\lib\nodefs-handler.js:468:21)
I also tried to copying imba.js to the same place with src, tried again and got this error message window:
I have tried all imba2 templates (webpack, snowpack, parcel) but none of them is working for me.
Now I am reporting issues related to webpack based template.
I download template using git clone https://github.com/imba/webpack-app-imba.git
and then I installed all dependencies using npm install
after all that when I start the app using
npm run start
, It failed and shows this error.
I am using node-v14.16.0
ERROR in Entry module not found: Error: Can't resolve 'imba/loader' in 'C:\Users\ssp\Documents\lang-imba\my-cards'
ERROR in multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src/client.imba
Module not found: Error: Can't resolve 'imba/loader' in 'C:\Users\ssp\Documents\lang-imba\my-cards'
@ multi (webpack)-dev-server/client?http://localhost:8080 (webpack)/hot/dev-server.js ./src/client.imba main[2]
i 「wdm」: Failed to compile.
Thanks
Dont't work command 'npm run express':
'''
D:\projects\sandbox\webpack-app-imba-master>npm run express
[email protected] express D:\projects\sandbox\webpack-app-imba-master
imba src/server.imba
D:\projects\sandbox\webpack-app-imba-master\node_modules\imba\src\imba\core\imba.imba:74
}; globalThis.ImbaContext = ImbaContext;
^
ReferenceError: globalThis is not defined
at Object. (D:\projects\sandbox\webpack-app-imba-master\node_modules\imba\src\imba\core\imba.imba:74:4)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.require.extensions..imba (D:\projects\sandbox\webpack-app-imba-master\node_modules\imba\bin\imba:67:14)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (D:\projects\sandbox\webpack-app-imba-master\node_modules\imba\src\imba\index.imba:2:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] express: imba src/server.imba
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] express 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\1\AppData\Roaming\npm-cache_logs\2021-01-05T22_44_35_822Z-debug.log
'''
My conf:
Windows 10 64 bit
Node v10.16.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.