A skeleton project to demonstrate a minimal setup of an IMQS frontend app leveraging the www-lib sub-repository.
- Copy all code from this repo to your new repository
- Find and replace all occurances of
wwwtemplate
in this repository with your project name.
- Change port in
sample_config/*.json
file to your service's port. - Add route from
/wwwtemplate
to appropriate port inrouter-config.json
and restart ImqsRouter service. - Build project by running:
node imqs-build.js prepare
- Run:
wwwtemplate.exe -c config_sample/config.json
- Open
http://localhost/wwwtemplate/www/
(trailing slash is required) and you should see the app running.
- Add imqs packages that are required from @imqs, by using npm install. For more information on imqs packages consult this page.
- Change directory to
/www
- Run
npm run dev
to build an in-memory version of the build artifacts. This will live-update the app as you develop. - Open
http://localhost:2501/wwwtemplate/www/
(trailing slash is required) and you should see the app running.
If you remove some of the node packages in package.json
that you know is not used in your project, the ForkTsCheckerWebpackPlugin compile will fail. This is because the plugin (for performance reasons) compiles all files in your entire project directory, including all files in js/lib
, whether or not the file gets imported anywhere in you project. However, webpack will exclude the unused libaries and code from your build artifacts. So removing node packages used by www-lib
, but not used by your project, won't have any effect on the build. The simplest thing to do is just to leave all node packages in package.json
, whether or not they get used.