webpackを使ったNodeアプリケーションの開発基盤構築
ソフトウェア | バージョン | 備考 |
---|---|---|
node | 7.3.0 | |
npm | 3.10.10 | |
yarn | 0.18.1 | |
vagrant | 1.8.7 | |
docker | 1.12.5 | |
docker-compose | 1.8.0 |
vagrant up
vagrant ssh
cd /vagrant
npm init -y
npm install express-generator -g
express -e .
npm install
npm start
npm install webpack@beta --save
npm install webpack-dev-server --save-dev
npm install webpack-dev-middleware --save-dev
npm install css-loader --save
npm install extract-text-webpack-plugin@2.0.0-rc.3 --save
npm install node-sass sass-loader --save
npm install babel-loader babel-core babel-preset-es2015 --save
npm install file-loader url-loader --save
npm install webpack-manifest-plugin --save
npmスクリプトを追加
npm run build
http://127.0.0.0:3000
で動作を確認する
npm install babel-cli --save
npm install babel-preset-es2015 --save
npm install clean-webpack-plugin --save
ビルドした内容をコミットしてHerokuにデプロイする
heroku create op10-no2
git push heroku master
heroku run npm run build
npm install --save-dev lodash
npm install mocha --save-dev
npm install power-assert babel-plugin-espower --save
npm install babel-plugin-transform-flow-strip-types --save
.babelrc
を追加
testを追加して動作を確認
npm test