Removes gulp dependency
Switches css building from gulp to postcss. Gulp was unnecessary overhead since nothing else is currently using it. Updates other dependencies. Also adjust some of the CI build processes to use less output (aside from errors) to decrease build time.
This commit is contained in:
parent
aef148722b
commit
2d38c277d2
|
@ -14,9 +14,9 @@ install:
|
||||||
- npm ci
|
- npm ci
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- npm run lint-prod
|
||||||
|
- npm run test-prod
|
||||||
- npm run deploy
|
- npm run deploy
|
||||||
- npm run test
|
|
||||||
- npm run lint
|
|
||||||
|
|
||||||
before_deploy: "echo 'node_modules' > .gitignore"
|
before_deploy: "echo 'node_modules' > .gitignore"
|
||||||
deploy:
|
deploy:
|
||||||
|
|
30
gulpfile.js
30
gulpfile.js
|
@ -1,30 +0,0 @@
|
||||||
const gulp = require("gulp");
|
|
||||||
const postcss = require("gulp-postcss");
|
|
||||||
const rename = require("gulp-rename");
|
|
||||||
|
|
||||||
const postcssImport = require("postcss-easy-import");
|
|
||||||
const postcssCSSO = require("postcss-csso");
|
|
||||||
|
|
||||||
gulp.task("build-css", buildCSS);
|
|
||||||
gulp.task("minify-css", minifyCSS);
|
|
||||||
|
|
||||||
gulp.task("watch-css", function() {
|
|
||||||
return gulp.watch(["./src/styles/*.css", "./src/styles/**/*.css"], minifyCSS);
|
|
||||||
});
|
|
||||||
|
|
||||||
function runBuild(minified) {
|
|
||||||
const plugins = [postcssImport];
|
|
||||||
if (minified) plugins.push(postcssCSSO({restructure: false}));
|
|
||||||
return gulp.src("./src/styles/index.css")
|
|
||||||
.pipe(postcss(plugins))
|
|
||||||
.pipe(rename("style.css"))
|
|
||||||
.pipe(gulp.dest("./dist"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildCSS() {
|
|
||||||
return runBuild(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function minifyCSS() {
|
|
||||||
return runBuild(true);
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
|
@ -6,16 +6,17 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack --progress --colors",
|
"build": "webpack --progress --colors",
|
||||||
"watch": "webpack --progress --colors --watch",
|
"watch": "webpack --progress --colors --watch",
|
||||||
"build-prod": "webpack --progress --colors --mode production -o dist/remote.js --devtool none",
|
"build-prod": "webpack --display errors-only --mode production -o dist/remote.js --devtool none",
|
||||||
"lint-js": "eslint --ext .jsx,.js src/",
|
"lint-js": "eslint --ext .jsx,.js src/",
|
||||||
"build-css": "gulp build-css",
|
"build-css": "postcss src/styles/index.css -o dist/style.css",
|
||||||
"watch-css": "gulp watch-css",
|
"watch-css": "postcss src/styles/index.css -o dist/style.css -w",
|
||||||
"build-prod-css": "gulp minify-css",
|
"build-prod-css": "postcss src/styles/index.css -o dist/style.css --no-map --env production",
|
||||||
"lint-css": "stylelint src/styles/*.css && stylelint src/styles/**/*.css",
|
"lint-css": "stylelint src/styles/*.css && stylelint src/styles/**/*.css",
|
||||||
"prod": "npm run build-prod && npm run build-prod-css",
|
|
||||||
"lint": "npm run lint-js && npm run lint-css",
|
"lint": "npm run lint-js && npm run lint-css",
|
||||||
"test": "mocha --require @babel/register --recursive \"./tests/*.js\"",
|
"test": "mocha --require @babel/register --recursive \"./tests/*.js\"",
|
||||||
"deploy": "npm run prod"
|
"lint-prod": "npm run lint-js -- --quiet && npm run lint-css -- --quiet",
|
||||||
|
"test-prod": "npm run test -- --reporter min",
|
||||||
|
"deploy": "npm run build-prod && npm run build-prod-css"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -27,22 +28,21 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/rauenzi/BetterDiscordApp",
|
"homepage": "https://github.com/rauenzi/BetterDiscordApp",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.10.5",
|
"@babel/core": "^7.12.3",
|
||||||
"@babel/preset-env": "^7.10.4",
|
"@babel/preset-env": "^7.12.1",
|
||||||
"@babel/preset-react": "^7.10.4",
|
"@babel/preset-react": "^7.12.1",
|
||||||
"@babel/register": "^7.10.5",
|
"@babel/register": "^7.12.1",
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
"babel-plugin-module-resolver": "^4.0.0",
|
"babel-plugin-module-resolver": "^4.0.0",
|
||||||
"circular-dependency-plugin": "^5.2.0",
|
"circular-dependency-plugin": "^5.2.0",
|
||||||
"eslint": "^7.5.0",
|
"eslint": "^7.12.0",
|
||||||
"eslint-plugin-react": "^7.21.3",
|
"eslint-plugin-react": "^7.21.5",
|
||||||
"gulp": "^4.0.2",
|
"mocha": "^8.2.0",
|
||||||
"gulp-postcss": "^8.0.0",
|
"postcss": "^8.1.4",
|
||||||
"gulp-rename": "^2.0.0",
|
"postcss-cli": "^8.1.0",
|
||||||
"mocha": "^8.1.1",
|
|
||||||
"postcss-csso": "^4.0.0",
|
"postcss-csso": "^4.0.0",
|
||||||
"postcss-easy-import": "^3.0.0",
|
"postcss-easy-import": "^3.0.0",
|
||||||
"stylelint": "^13.6.1",
|
"stylelint": "^13.7.2",
|
||||||
"stylelint-config-standard": "^20.0.0",
|
"stylelint-config-standard": "^20.0.0",
|
||||||
"webpack": "^4.43.0",
|
"webpack": "^4.43.0",
|
||||||
"webpack-cli": "^3.3.12"
|
"webpack-cli": "^3.3.12"
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
module.exports = ctx => {
|
||||||
|
return {
|
||||||
|
map: false,
|
||||||
|
plugins: {
|
||||||
|
"postcss-easy-import": {},
|
||||||
|
"postcss-csso": ctx.env === "production" ? {restructure: false} : false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue