我很难在 rails / Webpacker 项目上设置 Wercker。
我首先必须添加安装节点的步骤,然后是预编译反应包的步骤,然后是安装纱线。首先它很好,但后来我向项目添加了依赖项,并且知道我被困在 3 个依赖项上,并出现相同的错误消息:
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
这只发生在redux-thunk
,react-redux-i18n
和react-spinkit
我试图添加一个yarn install
通过该过程但没有解决问题的步骤。
这是我的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