Skip to content

Instantly share code, notes, and snippets.

View HiroshiHara's full-sized avatar
👽

hrhrs HiroshiHara

👽
View GitHub Profile
# node.js開発時にソースコード変更を監視し自動で再起動するプラグイン。
# サーバ起動をnodeコマンドの代わりにnodemonを使用する。
# ★インストール
npm install -g nodemon
# ★package.json > npm-scriptsにnodemon用スクリプトを追加(例)
scripts > dev > "nodemon app.js"
# ★起動
1.Apacheインストール
https://www.apachelounge.com/download/からDLしたzipを適当に配置
1-1.APACHE_HOME, pathを環境変数に追加
1-2.httpd.confの編集
1-2-1.ServerRootの値をApacheのルートディレクトリに変更
1-2-2.Listenの値を他と重複しないポート番号に変更(デフォルトは80)
1-2-3.ServerNameの値をアクセス先のドメイン名に変更(DNS設定していない場合はIPアドレスを設定する)
1-3.サービスの登録
1-3-1.APACHE_HOME\binでhttpd -k installでサービス登録
1-3-2.net start Apache2.4で起動
# npm install [packege name]
ローカルインストール(プロジェクトのルートディレクトリ)
# npm install -g [package name]
グローバルインストール(npmのルートディレクトリ)
# npm install --save [package name]
ローカルインストール
+ package.jsonのdependenciesに追記
* dependencies... モジュールの動作に必要なもの
* npm initしてないと使えない
# npm install --save-dev
1.拡張機能
・Debugger for Chrome
・ESLint
・indent-rainbow
・JavaScript (ES6) code snippets
・npm
・Prettier
・code-eol 2019(Latest)(改行コード可視化)
・EJS language support(EJSのコードスニペット)
# Herokuでよく使うコマンドのメモ
# 起動中のアプリケーションのログをリアルタイムで取得
heroku logs --tail -a [アプリケーション名]
# 起動中のアプリケーションのbashを起動
heroku run bash -a [アプリケーション名]
# デプロイを中断
heroku builds:cancel -a [アプリケーション名]
@HiroshiHara
HiroshiHara / webpack.config.js
Last active August 12, 2020 14:40
webpack.config.js for React development. (WIP)
// get *path* module from nodejs.
const path = require("path");
// resolve the *dist* path.
const outputPath = path.resolve(__dirname, "dist");
module.exports = {
/**
* Output mode.
* production...
* minified files as possible.
@HiroshiHara
HiroshiHara / package.json
Last active July 26, 2020 06:24
package.json for React + webpack + babel development. (WIP)
{
"name": "enter project name",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest",
"flow": "flow",
"start": "webpack-dev-server --open",
"build": "webpack"
@HiroshiHara
HiroshiHara / jest.config.js
Last active July 26, 2020 06:21
jest.config.js for personal devopment.
module.exports = {
verbose: true,
};
@HiroshiHara
HiroshiHara / .flowconfig
Created July 18, 2020 11:59
.flowconfig for React development.
[ignore]
.*/node_modules/.*
[include]
[libs]
[lints]
[options]
@HiroshiHara
HiroshiHara / .babelrc.json
Last active July 26, 2020 06:22
.babelrc.json for React development.
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage"
}
],
"@babel/preset-react",
"@babel/preset-flow"