Commit 8390dd24 by hfpp2012 yinsigan

add OpenBrowserPlugin

1 parent e6ba54c3
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"css-loader": "^0.28.1", "css-loader": "^0.28.1",
"extract-text-webpack-plugin": "^2.1.0", "extract-text-webpack-plugin": "^2.1.0",
"node-sass": "^4.5.3", "node-sass": "^4.5.3",
"open-browser-webpack-plugin": "^0.0.5",
"sass-loader": "^6.0.5", "sass-loader": "^6.0.5",
"style-loader": "^0.17.0" "style-loader": "^0.17.0"
} }
......
...@@ -24,12 +24,18 @@ const extractSass = ExtractTextPlugin.extract({ ...@@ -24,12 +24,18 @@ const extractSass = ExtractTextPlugin.extract({
fallback: "style-loader" fallback: "style-loader"
}) })
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = { module.exports = {
entry: './client/index.js', entry: './client/index.js',
output: { output: {
path: path.resolve('dist'), path: path.resolve('dist'),
filename: 'index_bundle.js' filename: 'index_bundle.js'
}, },
devServer: {
inline: true,
port: 3000
},
module: { module: {
loaders: [ loaders: [
{ test: /\.(js|jsx)$/, loader: 'babel-loader', exclude: /node_modules/ }, { test: /\.(js|jsx)$/, loader: 'babel-loader', exclude: /node_modules/ },
...@@ -38,6 +44,7 @@ module.exports = { ...@@ -38,6 +44,7 @@ module.exports = {
}, },
plugins: [ plugins: [
HtmlWebpackPluginConfig, HtmlWebpackPluginConfig,
new ExtractTextPlugin("styles.css") new ExtractTextPlugin("styles.css"),
new OpenBrowserPlugin({ url: 'http://localhost:3000' })
] ]
} }
...@@ -1959,14 +1959,14 @@ inflight@^1.0.4: ...@@ -1959,14 +1959,14 @@ inflight@^1.0.4:
once "^1.3.0" once "^1.3.0"
wrappy "1" wrappy "1"
inherits@2, inherits@2.0.3, inherits@~2.0.0: inherits@2, inherits@2.0.1, inherits@^2.0.1, inherits@~2.0.1:
version "2.0.3"
resolved "http://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
inherits@2.0.1, inherits@^2.0.1, inherits@~2.0.1:
version "2.0.1" version "2.0.1"
resolved "http://registry.npm.taobao.org/inherits/download/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" resolved "http://registry.npm.taobao.org/inherits/download/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
inherits@2.0.3, inherits@~2.0.0:
version "2.0.3"
resolved "http://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
ini@~1.3.0: ini@~1.3.0:
version "1.3.4" version "1.3.4"
resolved "http://registry.npm.taobao.org/ini/download/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" resolved "http://registry.npm.taobao.org/ini/download/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
...@@ -2672,6 +2672,16 @@ once@^1.3.0, once@^1.3.3: ...@@ -2672,6 +2672,16 @@ once@^1.3.0, once@^1.3.3:
dependencies: dependencies:
wrappy "1" wrappy "1"
open-browser-webpack-plugin@^0.0.5:
version "0.0.5"
resolved "http://registry.npm.taobao.org/open-browser-webpack-plugin/download/open-browser-webpack-plugin-0.0.5.tgz#5e6dc6f8b8797331e212985de218572d84c0521f"
dependencies:
open "0.0.5"
open@0.0.5:
version "0.0.5"
resolved "http://registry.npm.taobao.org/open/download/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc"
opn@4.0.2: opn@4.0.2:
version "4.0.2" version "4.0.2"
resolved "http://registry.npm.taobao.org/opn/download/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" resolved "http://registry.npm.taobao.org/opn/download/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!