mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-28 02:30:46 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 12a446f747 | |||
| 262c0bbc9e | |||
| 0906a22faa | |||
| d94724832e | |||
| 4c7e9732af | |||
| 570db8e4ea |
@@ -8,11 +8,11 @@ The following features are planned to be included in the final version:
|
||||
- [x] Webpack and Webpack-Dev-Server, including hot-loader
|
||||
- [x] Babel and JSX
|
||||
- [x] Mocha Unit tests (*optional*)
|
||||
- [ ] React.Router
|
||||
- [x] EsLint Support
|
||||
- [x] No dependency on grunt, gulp or the next hot taskrunner!
|
||||
|
||||
## Todo
|
||||
- [ ] Better performance for webpack builds
|
||||
- [ ] The dynamic webpack configuration is clunky, there must be a better way to do that!
|
||||
- [ ] Karmas webpack configuration is not included in the global webpack.config.js file, but it really should
|
||||
|
||||
|
||||
+5
-2
@@ -23,7 +23,7 @@ module.exports = function(config) {
|
||||
},
|
||||
webpack: {
|
||||
cache: true,
|
||||
devtool: 'inline-source-map',
|
||||
devtool: 'eval',
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
@@ -33,7 +33,10 @@ module.exports = function(config) {
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
loader: 'babel-loader',
|
||||
exclude: /node_modules/
|
||||
include: [
|
||||
path.join(__dirname, 'src'),
|
||||
path.join(__dirname, 'test')
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-webpack-template",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.8",
|
||||
"description": "A base skeleton template for react and webpack without task runners",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -11,8 +11,9 @@
|
||||
"serve:dist": "node server.js --env=dist",
|
||||
"dist": "npm run copy & webpack --env=dist",
|
||||
"lint": "eslint ./src",
|
||||
"copy": "copyfiles -f ./src/index.html ./dist",
|
||||
"clean": "rimraf dist/*"
|
||||
"copy": "copyfiles -f ./src/index.html ./src/favicon.ico ./dist",
|
||||
"clean": "rimraf dist/*",
|
||||
"patch-release": "npm version patch && npm publish && git push --follow-tags"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -3,11 +3,14 @@ require('styles/App.css');
|
||||
|
||||
import React from 'react/addons';
|
||||
|
||||
let yeomanImage = require('../images/yeoman.png');
|
||||
|
||||
class AppComponent extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="index">
|
||||
Content
|
||||
<img src={yeomanImage} alt="Yeoman Generator" />
|
||||
<div className="notice">Please edit <code>src/components/Main.js</code> to get started!</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -1 +1,21 @@
|
||||
/* Base Application Styles */
|
||||
body {
|
||||
color: #fff;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.index img {
|
||||
margin: 40px auto;
|
||||
border-radius: 4px;
|
||||
background: #fff;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.index .notice {
|
||||
margin: 20px auto;
|
||||
padding: 15px 0;
|
||||
text-align: center;
|
||||
border: 1px solid #000;
|
||||
border-width: 1px 0;
|
||||
background: #666;
|
||||
}
|
||||
|
||||
+3
-3
@@ -37,7 +37,7 @@ var config = {
|
||||
preLoaders: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
include: path.join(__dirname, 'src'),
|
||||
loader: 'eslint-loader'
|
||||
}
|
||||
],
|
||||
@@ -59,7 +59,7 @@ switch(env) {
|
||||
case 'dist':
|
||||
config.entry = './src/components/run';
|
||||
config.cache = false;
|
||||
config.devtool = false;
|
||||
config.devtool = 'sourcemap';
|
||||
config.plugins = [
|
||||
new webpack.optimize.DedupePlugin(),
|
||||
new webpack.optimize.UglifyJsPlugin(),
|
||||
@@ -83,7 +83,7 @@ switch(env) {
|
||||
'./src/components/run'
|
||||
];
|
||||
config.cache = true;
|
||||
config.devtool = 'sourcemap';
|
||||
config.devtool = 'eval';
|
||||
config.plugins = [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoErrorsPlugin()
|
||||
|
||||
Reference in New Issue
Block a user