Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Add 'dev' script to do a development build#166

Merged
mareklibra merged 1 commit intokubevirt:masterfrom
vojtechszocs:add-dev-script
Jan 9, 2019
Merged

Add 'dev' script to do a development build#166
mareklibra merged 1 commit intokubevirt:masterfrom
vojtechszocs:add-dev-script

Conversation

@vojtechszocs
Copy link
Contributor

Addressing comment #150 (comment)

  • add dev script to do a development build (one-time) without any pre-checks
  • ensure that regular production build (build script) has NODE_ENV set accordingly
  • updated developer guideline

Q: why not use --watch for the dev script?
A: our build is split into two parts, JS and Sass. JS files are processed by Babel, Sass files are copied as-is. While Babel supports --copy-files to include files that weren't part of the JS compilation, this would require changing --out-dir and transforming file paths, for which I didn't find any suitable Babel plugin. We could use webpack and its watch mode on top of Babel, but I'm reluctant to add such complexity for now.

Q: is there actually a difference between production and development build?
A: not right now 😃 it seems like NODE_ENV has no effect on our build outputs at the moment:

$ yarn build && mv dist dist_prod
$ yarn dev && mv dist dist_dev
$ diff -r dist_prod dist_dev # no results

@coveralls
Copy link

coveralls commented Jan 8, 2019

Pull Request Test Coverage Report for Build 481

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 87.749%

Totals Coverage Status
Change from base Build 479: 0.0%
Covered Lines: 1647
Relevant Lines: 1796

💛 - Coveralls

Copy link
Contributor

@atiratree atiratree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mareklibra mareklibra merged commit c658957 into kubevirt:master Jan 9, 2019
@atiratree
Copy link
Contributor

atiratree commented Jan 9, 2019

Watch mode would be nice to have though. Mainly because web-ui dev watch mode breaks when we delete our dist. Then, web-ui dev needs to be restarted.

web-ui dev output:

ERROR in ./public/style.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 9)

ERROR in ..-components/dist/js/index.js
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 8)
ENOENT: no such file or directory, open '$AT_LOCATION/kube-web-ui-components/dist/js/index.js'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments