Git Product home page Git Product logo

webpack-app-imba's Introduction

Hello World Imba

Tiny template for Imba using webpack & webpack-dev-server

Getting started

git clone https://github.com/imba/webpack-app-imba
cd webpack-app-imba
npm install

You can run the app in two ways, either served via the webpack-dev-server or Express.

Webpack

npm start
# Go to url logged out by devserver
# usually "Project is running at http://localhost:8080/"

Server side

First make sure you have built or are watching the client

npm run watch

Then in another tab / session

npm run express

webpack-app-imba's People

Contributors

aalemayhu avatar baartko avatar cstffx avatar dependabot[bot] avatar iruoy avatar somebee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webpack-app-imba's Issues

Setup development and production mode in webpack config

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/

Dont't work command 'npm run express'

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

Minifying the example

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. :)

Can't resolve 'imba/loader'

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

Doesn't Compile on Windows

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:

capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.