我很难在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发布于 2017-10-16 12:59:38
找到了一种在预编译之前添加删除节点模块的步骤:
- script:
name: delete node modules
code: rm -rf node_modules更新
我现在有一个干净的Wercker设置处理测试,系统测试与铬无头,rubocop,eslint和手写笔。你可以在这里找到它:https://gist.github.com/adesurirey/7c013bfa1a9bed9d56ffea54db5d6288
https://stackoverflow.com/questions/46736345
复制相似问题