-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ics-creative/170330_webpack
- Loading branch information
Showing
2 changed files
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)をご確認ください。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters