Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ics-ikeda committed Mar 15, 2018
2 parents ab90cce + 3965cbb commit f9e22de
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
37 changes: 37 additions & 0 deletions tutorial-webpack-dev-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# webpack-dev-server のサンプル

ICS MEDIA「[最新版で学ぶwebpack 4入門](https://ics.media/entry/12140)」で紹介している webpack-dev-server の解説用サンプルです。

## 使い方

インストール

```bash
npm i -D webpack webpack-cli webpack-dev-server
```

webpack.config.jsの設定ファイル

```js
module.exports = {
// モード値を production に設定すると最適化された状態で、
// development に設定するとソースマップ有効でJSファイルが出力される
mode: 'development',

// ローカル開発用環境を立ち上げる
// 実行時にブラウザが自動的に localhost を開く
devServer: {
contentBase: 'dist',
open: true
}
};
```

実行

```bash
npx webpack-dev-server
```


詳しくは[記事の説明](https://ics.media/entry/12140)をご確認ください。
7 changes: 0 additions & 7 deletions tutorial-webpack-dev-server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ module.exports = {
// development に設定するとソースマップ有効でJSファイルが出力される
mode: 'development',


optimize : {
splitChunks: {
chunks : "all"
}
},

// ローカル開発用環境を立ち上げる
// 実行時にブラウザが自動的に localhost を開く
devServer: {
Expand Down

0 comments on commit f9e22de

Please sign in to comment.