mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 20:53:15 +08:00
Added new cleanup and copy scripts
This commit is contained in:
@@ -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:
|
||||
|
||||
+12
-6
@@ -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",
|
||||
|
||||
+1
-1
@@ -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
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user