Created
April 8, 2015 05:44
-
-
Save bjrmatos/d6d6b18f30853b9acc26 to your computer and use it in GitHub Desktop.
webpack dev server config
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
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>React Interval</title> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script src="http://localhost:9000/webpack-dev-server.js"></script> | |
<script src="/app.js"></script> | |
</body> | |
</html> |
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
{ | |
"name": "webpack-playground", | |
"version": "1.0.0", | |
"description": "Test webpack", | |
"main": "app.js", | |
"scripts": { | |
"start": "webpack-dev-server --config webpack.config.js --hot", | |
"build": "webpack --config webpack.config.js --progress --profile --colors", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "BJR Matos <[email protected]>", | |
"license": "MIT", | |
"devDependencies": { | |
"babel-core": "^5.0.10", | |
"babel-loader": "^5.0.0", | |
"webpack": "^1.8.0", | |
"webpack-dev-server": "^1.8.0" | |
}, | |
"dependencies": { | |
"react": "^0.12.2" | |
} | |
} |
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
'use strict'; | |
var path = require('path'), | |
webpack = require('webpack'); | |
module.exports = { | |
entry: [ | |
'webpack/hot/dev-server', | |
'./app' | |
], | |
devServer: { | |
contentBase: '.', | |
host: 'localhost', | |
port: 9000 | |
}, | |
devtool: 'eval', | |
debug: true, | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: 'app.js' | |
}, | |
module: { | |
loaders: [ | |
{ test: /\.js|\.jsx/, loaders: ['babel-loader'], exclude: /node_modules/ } | |
] | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx'] | |
}, | |
plugins: [ | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment