Skip to content

Commit

Permalink
Update npm runner and jobs, add git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
zourdyzou committed Jun 29, 2022
1 parent 9e3a760 commit 4b554e2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
31 changes: 23 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"name": "minesweeper",
"version": "1.0.0",
"description": "Minesweeper game",
"main": "index.js",
"main": "webpack.config.js",
"scripts": {
"build": "npm run build:production",
"build:production": "npm run clean:dist && webpack --node-env production",
"build:development": "npm run clean:dist && webpack --node-env development",
"bundle-analysis": "webpack --node-env production --env showBundleAnalysis",
"watch": "webpack --watch --mode=development",
"start": "webpack serve",
"clean": "rm -rf node_modules coverage dist",
"clean:dist": "rm -rf dist",
"test": "jest"
"test": "jest",
"build": "cross-env NODE_ENV=production webpack --config webpack.config.js",
"profile": "cross-env NODE_ENV=production webpack --profile --json --config webpack.config.js > ./dist/profile.json && webpack-bundle-analyzer ./dist/profile.json",
"start": "cross-env WEBPACK_IS_DEV_SERVER=true NODE_ENV=development webpack serve --config webpack.config.js",
"release": "npm version patch",
"update-hooks": "npx simple-git-hooks",
"prerelease": "npm run update-hooks",
"postinstall": "npm run update-hooks"
},
"directories": {
"example": "examples"
Expand All @@ -36,6 +37,10 @@
"engines": {
"node": ">=16.8.0"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged",
"post-commit": "git update-index --again"
},
"homepage": "https://github.com/zourdyzou/minesweeper#readme",
"devDependencies": {
"@babel/cli": "^7.17.10",
Expand Down Expand Up @@ -134,5 +139,15 @@
"react-dom": "^18.2.0",
"classnames": "^2.3.1",
"normalize.css": "^8.0.1"
},
"importSort": {
".ts, .tsx": {
"style": "module-and-prefix",
"parser": "typescript"
},
".js, .jsx": {
"style": "module-and-prefix",
"parser": "babylon"
}
}
}
1 change: 0 additions & 1 deletion webpack/config/devServer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/**
* Created by: Andrey Polyakov ([email protected])
* @see https://webpack.js.org/configuration/dev-server/
*/

Expand Down
3 changes: 0 additions & 3 deletions webpack/dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
* Created by: Andrey Polyakov ([email protected])
*/
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';

import {devServerConfig} from './config';
Expand Down
2 changes: 1 addition & 1 deletion webpack/plugins/pluginHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {rootDir} from '../utils/env';
const config = {
filename: 'index.html',
inject: true,
template: join(rootDir, './src/index.html'),
template: join(rootDir, './public/index.html'),
};

export const htmlWebpackPlugin = new HtmlWebpackPlugin(config);

0 comments on commit 4b554e2

Please sign in to comment.