diff --git a/README.md b/README.md index 9cacc78..2990e43 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ The following features are planned to be included in the final version: - [x] EsLint Support - [x] No dependency on grunt, gulp or the next hot taskrunner! +## Todo +- [ ] 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 + ## What is it for? This template can be used directly for the creation of new projects. Also it will be the "template" for the next version of generator-react-webpack. @@ -24,9 +28,9 @@ npm start # or npm run serve # Start the dev-server with the dist version -npm run servedist +npm run serve:dist -# Just build the dist version +# Just build the dist version and copy static files npm run dist # Run unit tests @@ -34,6 +38,12 @@ npm test # Lint all files in src (also automatically done AFTER tests are run) npm run lint + +# Clean up the dist directory +npm run clean + +# Just copy the static assets +npm run copy ``` You can also use your globally installed version of webpack like this: diff --git a/package.json b/package.json index de2c385..9952c46 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,18 @@ { "name": "react-webpack-template", - "version": "0.0.3", - "description": "Base template for react and webpack", + "version": "0.0.4", + "description": "A base skeleton template for react and webpack without task runners", "main": "index.js", "scripts": { "start": "node server.js --env=dev", "test": "karma start", "posttest": "npm run lint", "serve": "node server.js --env=dev", - "servedist": "node server.js --env=dist", - "dist": "webpack --env=dist", - "lint": "eslint ./src" + "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/*" }, "repository": { "type": "git", @@ -19,7 +21,9 @@ "keywords": [ "React", "Webpack", - "Babel" + "Babel", + "Boilerplate", + "Demo" ], "author": "Christian Schilling (cs@weblogixx.de)", "license": "MIT", @@ -31,6 +35,7 @@ "babel-core": "^5.8.22", "babel-loader": "^5.3.2", "chai": "^3.2.0", + "copyfiles": "^0.2.1", "css-loader": "^0.16.0", "eslint": "^1.2.1", "eslint-loader": "^1.0.0", @@ -50,6 +55,7 @@ "open": "0.0.5", "phantomjs": "^1.9.18", "react-hot-loader": "^1.2.9", + "rimraf": "^2.4.3", "style-loader": "^0.12.3", "url-loader": "^0.5.6", "webpack": "^1.12.0", diff --git a/webpack.config.js b/webpack.config.js index 19d0a11..a6e7ff1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ var config = { port: port, debug: true, output: { - path: path.join(__dirname, 'dist'), + path: path.join(__dirname, 'dist/assets'), filename: 'app.js', publicPath: publicPath },