bbc / VideoContext

An experimental HTML5 & WebGL video composition and rendering API.
http://bbc.github.io/VideoContext/
Apache License 2.0
1.33k stars 157 forks source link

Make webpack build mode 'development' when not running in CI pipeline #136

Closed germain-gg closed 5 years ago

germain-gg commented 5 years ago

This PR aims to speed up the webpack build time when not running in a CI environment.

The mode production does a lot of great optimisation. However this comes at a cost... "time". Those optimisations are pretty much useless for development.

Environment variables config are set in the .travis.yml file.

I've also updated the ESLint config so that it is enabled but also acknowledges that this files runs in a node environment with its own set of global variables.

Couldn't test this against the Travis Pipeline but I'm fairly confident that it should work 👍

germain-gg commented 5 years ago

I am wondering, do you know where webpack.commonjs2.config.js is used? I have the feeling that this is never used... but just want to double check before I can delete it

PTaylour commented 5 years ago

I am wondering, do you know where webpack.commonjs2.config.js is used? I don't think it is. Looks safe to delete

germain-gg commented 5 years ago

The build was failing because I misread the Travis documentation! This is now fix and should be passing all fine! Each line in the env will trigger a build. And for the build step we need two environment variables, TEST_SUITE and NODE_ENV. My latest commit fixes that

I have deleted webpack.commonjs2.config.js as part of #140

PTaylour commented 5 years ago

Looks like it's breaking the TEST_SUIT env variable.

The test.sh script is saying:

exit 1. TEST_SUITE env should be set to unit, integration or regression

Maybe it's setting it to "build NODE_ENV=production"

germain-gg commented 5 years ago

I'm very confused about this because if you look at the travis config that is being applied https://travis-ci.org/bbc/VideoContext/builds/482417790/config

It does not match with the diff of that file in the current PR...

Should I re-open a PR 🤔 ?

PTaylour commented 5 years ago

This one looks more up to date https://travis-ci.org/bbc/VideoContext/jobs/488508070/config

And it's failing for a different reason

> videocontext@0.52.12 lint /home/travis/build/bbc/VideoContext
> eslint '{src,test}/**/*.js'
sh: 1: eslint: not found
PTaylour commented 5 years ago

which does look like a problem our end

https://stackoverflow.com/questions/38083622/why-travis-ci-no-run-npm-install-in-node-env-production