diff --git a/README.md b/README.md index a4f1f64f85..2d3d1b602e 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ dspace-angular ├── karma.conf.js * Unit Test configuration file ├── nodemon.json * Nodemon (https://nodemon.io/) configuration ├── package.json * This file describes the npm package for this project, its dependencies, scripts, etc. +├── postcss.config.json * PostCSS (http://postcss.org/) configuration file ├── protractor.conf.js * E2E tests configuration file ├── resources * Folder for static resources │   ├── i18n * Folder for i18n translations diff --git a/package.json b/package.json index d72b0e2f02..e43a0f3df2 100644 --- a/package.json +++ b/package.json @@ -21,14 +21,16 @@ "clean:prod": "npm run clean:ngc && npm run clean:json && npm run clean:css && npm run clean:css:ts && npm run clean:scss:ts && npm run clean:css:shim:ts && npm run clean:scss:shim:ts && npm run clean:dist", "clean": "npm run clean:log && npm run clean:prod && npm run clean:coverage && npm run clean:node", "sass": "node-sass src -o src --include-path node_modules --output-style compressed -q", - "sass:watch": "node-sass -w src -o src --include-path node_modules --output-style compressed -q", + "postcss": "node_modules/postcss-cli/bin/postcss -c postcss.config.json", + "style": "npm run sass && npm run postcss", + "style:watch": "nodemon -e scss -w src -x \"npm run style\"", "rollup": "rollup -c rollup-server.js && rollup -c rollup-client.js", - "prebuild": "npm run clean:dist && npm run sass", + "prebuild": "npm run clean:dist && npm run style", "build": "webpack --progress", "build:prod": "webpack --config webpack.prod.config.ts", "build:prod:rollup": "npm run build:prod && npm run rollup", - "build:prod:ngc": "npm run clean:prod && npm run sass && npm run ngc && npm run build:prod:rollup", - "build:prod:ngc:json": "npm run clean:prod && npm run sass && npm run ngc && npm run build:prod:json:rollup", + "build:prod:ngc": "npm run clean:prod && npm run style && npm run ngc && npm run build:prod:rollup", + "build:prod:ngc:json": "npm run clean:prod && npm run style && npm run ngc && npm run build:prod:json:rollup", "build:prod:json": "webpack --config webpack.prod.config.ts --json | webpack-bundle-size-analyzer", "build:prod:json:rollup": "npm run build:prod:json && npm run rollup", "ngc": "ngc -p tsconfig.aot.json", @@ -37,7 +39,7 @@ "server:dev": "nodemon --debug dist/server/index.js", "start": "npm run server", "start:dev": "npm run clean:prod && npm run build && npm run server", - "watch": "webpack -w & npm run sass:watch", + "watch": "webpack -w & npm run style:watch", "watch:dev:server": "concurrently \"npm run server:dev\" \"npm run watch\"", "watch:dev": "npm run clean:prod && npm run build && npm run watch:dev:server", "watch:prod:server": "concurrently \"npm run server\" \"npm run watch\"", @@ -83,6 +85,7 @@ "angular2-platform-node": "2.1.0-rc.1", "angular2-universal": "2.1.0-rc.1", "angular2-universal-polyfills": "2.1.0-rc.1", + "autoprefixer": "^6.5.4", "body-parser": "1.15.2", "bootstrap": "4.0.0-alpha.5", "compression": "1.6.2", @@ -114,10 +117,10 @@ "@types/node": "6.0.52", "@types/serve-static": "1.7.31", "@types/webfontloader": "1.6.27", - "angular2-template-loader": "0.6.0", - "autoprefixer": "6.5.4", "ajv": "4.2.0", "ajv-keywords": "1.1.1", + "angular2-template-loader": "0.6.0", + "autoprefixer": "6.5.4", "awesome-typescript-loader": "2.2.4", "codelyzer": "2.0.0-beta.3", "concurrently": "3.1.0", @@ -144,6 +147,7 @@ "karma-webpack": "1.8.0", "node-sass": "4.0.0", "nodemon": "1.11.0", + "postcss-cli": "^2.6.0", "protractor": "~4.0.14", "protractor-istanbul-plugin": "~2.0.0", "raw-loader": "0.5.1", diff --git a/postcss.config.json b/postcss.config.json new file mode 100644 index 0000000000..70df875975 --- /dev/null +++ b/postcss.config.json @@ -0,0 +1,9 @@ +{ + "use": ["autoprefixer"], + "input": "src/**/*.css", + "replace": true, + "local-plugins": true, + "autoprefixer": { + "browsers": "last 2 versions" + } +}