diff --git a/package.json b/package.json index 98e54de..bbbe8b1 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,19 @@ { "name": "nightlybuilders-react-boilerplate", "version": "0.0.1", - "description": "This boilerplate kick starts your next React based web application.", + "description": + "This boilerplate kick starts your next React based web application.", "repository": { "type": "git", - "url": "git+https://github.com/nightlybuilders/nightlybuilders-react-boilerplate.git" + "url": + "git+https://github.com/nightlybuilders/nightlybuilders-react-boilerplate.git" }, "bugs": { - "url": "https://github.com/nightlybuilders/nightlybuilders-react-boilerplate/issues" + "url": + "https://github.com/nightlybuilders/nightlybuilders-react-boilerplate/issues" }, - "homepage": "https://github.com/nightlybuilders/nightlybuilders-react-boilerplate#readme", + "homepage": + "https://github.com/nightlybuilders/nightlybuilders-react-boilerplate#readme", "main": "src/server/index.js", "author": "Stefan Natter ", "contributors": [ @@ -24,36 +28,38 @@ ], "license": "Apache 2.0", "scripts": { - "build": "cross-env NODE_ENV=production BABEL_ENV=production webpack -p --config webpack/prod.config.js", - "build:analyse": "cross-env NODE_ENV=production BABEL_ENV=production webpack -p --config webpack/prod.analyse.config.js", - "build:dev": "webpack --config webpack/dev.config.js", + "build": + "rimraf cross-env NODE_ENV=production BABEL_ENV=production webpack -p --config webpack/prod.config.js", + "build:analyse": + "npm run prebuild && cross-env NODE_ENV=production BABEL_ENV=production webpack -p --config webpack/prod.analyse.config.js", + "build:dev": "npm run prebuild && webpack --config webpack/dev.config.js", "build:storybook": "build-storybook -o dist/storybook", "format": "eslint --fix ./src/**/*.js", "format:scss": "stylelint --fix ./src/**/*.scss", "lint": "eslint ./**/*.js", "lint:scss": "stylelint ./src/**/*.scss", + "prebuild": "rimraf dist", "precommit": "lint-staged", "start": "npm run build && node .", "storybook": "start-storybook -p 9001 -c storybook", "test": "jest", "test:coverage": "jest --coverage", - "watch:client": "webpack --config webpack/dev.config.js --watch", + "watch:client": + "npm run prebuild && webpack --config webpack/dev.config.js --watch", "watch:server": "nodemon ./src/server", "watch:test": "jest --watch" }, "lint-staged": { - "*.scss": [ - "npm run format:scss", - "git add" - ], + "*.scss": ["npm run format:scss", "git update-index --again"], "*.js": [ "npm run format", - "git add", + "git update-index --again", "jest --findRelatedTests" ] }, "devDependencies": { - "@natterstefan/eslint-config-ns": "git+https://github.com/natterstefan/eslint-config-ns.git#8470efb8bf1eac323eaa93b9d969a2c4ea6e38be", + "@natterstefan/eslint-config-ns": + "git+https://github.com/natterstefan/eslint-config-ns.git#8470efb8bf1eac323eaa93b9d969a2c4ea6e38be", "@storybook/addon-actions": "4.0.0-alpha.14", "@storybook/addon-options": "4.0.0-alpha.14", "@storybook/react": "4.0.0-alpha.14", @@ -136,6 +142,7 @@ "react-router-dom": "4.3.1", "redux": "4.0.0", "redux-thunk": "2.3.0", + "rimraf": "2.6.2", "serialize-javascript": "1.5.0" } } diff --git a/src/static/images/350x150.png b/src/static/images/350x150.png new file mode 100644 index 0000000..299c2af Binary files /dev/null and b/src/static/images/350x150.png differ diff --git a/webpack/common.config.js b/webpack/common.config.js index 03f9d49..293d133 100644 --- a/webpack/common.config.js +++ b/webpack/common.config.js @@ -74,8 +74,14 @@ module.exports = { [ { context: './src/static', - from: `${path.resolve(__dirname, '..', 'src', 'static', 'images')}/**/*.+(png|jpg|gif)`, - to: `${BUILD_DIR}/static/images`, + from: `${path.resolve( + __dirname, + '..', + 'src', + 'static', + 'images', + )}/**/*.+(png|jpg|gif|svg)`, + to: `${BUILD_DIR}/static`, }, { context: './src/static', diff --git a/yarn.lock b/yarn.lock index 439b689..a5782a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10233,7 +10233,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@2.6.2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: