I struggle setting up Wercker on a rails / Webpacker project.
I first had to add steps to install node, then another to pre-compile react packs, then to install yarn. First it was good but then I added dependencies to the project and know I'm stuck on 3 dependencies with the same error message :
ERROR in ./app/javascript/app/index.js
Module not found: Error: Can't resolve 'redux-thunk' in '/pipeline/source/app/javascript/app'
@ ./app/javascript/app/index.js 5:0-32
@ ./app/javascript/packs/app.js
That's happening only with redux-thunk
, react-redux-i18n
and react-spinkit
I've tried to add a step yarn install
which passes through the process but doesn't solve the problem.
Here is my wercker.yml
:
# wercker.yml
box: ruby:2.4.1
services:
- redis
- postgres
build:
steps:
- louischavane/install-phantomjs@0.0.5
- rails-database-yml
- script:
name: nokogiri tricks
code: bundle config build.nokogiri --use-system-libraries
- bundle-install
- bigtruedata/install-node@2.1.1
- akupila/yarn@0.2.0
- script:
name: yarn-install
code: yarn install
- script:
name: pre-compile react packs
code: NODE_ENV=test bundle exec rails webpacker:compile
- script:
name: run migration
code: rake db:migrate RAILS_ENV=test
- script:
name: load fixture
code: rake db:fixtures:load RAILS_ENV=test
- script:
name: run rubocop
code: bundle exec rubocop
- script:
name: test
code: bundle exec rake test RAILS_ENV=test