Skip to content

Commit

Permalink
⚙️ Chore(app): remove additional chunks and add README.MD to npm build
Browse files Browse the repository at this point in the history
  • Loading branch information
INeedJobToStartWork committed Jan 12, 2024
1 parent 4b7adca commit 784a9c1
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 19 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# commitsmile

## 0.3.7

### Patch Changes

- fix build output for npm (add ReadMe and reduce size)

## 0.3.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ If Path:
- do not include filename it will use standard process to find.
- include - will just check this file (faster way)

### Init config
<!-- ### Init config
to init config we use optional paremeter `--init`:
```bash copy
npm run commitSmile --init
```
``` -->
17 changes: 2 additions & 15 deletions config/webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const __dirname = path.resolve();

export default {
entry: {
index: path.resolve(__dirname, "src/index.ts"),
readme: path.resolve(__dirname, "readme.md")
index: path.resolve(__dirname, "src/index.ts")
},

module: {
Expand All @@ -16,19 +15,6 @@ export default {
use: {
loader: "swc-loader"
}
},
{
exclude: "/\\node_modules\\[^\\]+$/gusm",
test: /\.(json|md)$/i,
type: "javascript/auto",
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]"
}
}
]
}
]
},
Expand All @@ -38,6 +24,7 @@ export default {
clean: true,
filename: "[name].cjs",
path: path.resolve(__dirname, "lib"),
chunkLoading: false,
library: {
type: "commonjs2",
export: "default"
Expand Down
10 changes: 9 additions & 1 deletion config/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import webpackBaseConfig from "./webpack.base.js";
import bundle from "bundle-declarations-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
import path from "path";
import { merge } from "webpack-merge";

const __dirname = path.resolve();
const PATHOUT = path.resolve(__dirname, "dist");

export default merge(webpackBaseConfig, {
mode: "production",
Expand All @@ -23,9 +25,15 @@ export default merge(webpackBaseConfig, {
compilationOptions: {},
removeEmptyLines: false,
removeEmptyExports: false
}),
new CopyPlugin({
patterns: [
{ from: path.resolve(__dirname, "README.md"), to: PATHOUT },
{ from: path.resolve(__dirname, "Package.json"), to: PATHOUT }
]
})
],
output: {
path: path.resolve(__dirname, "dist")
path: PATHOUT
}
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitsmile",
"version": "0.3.6",
"version": "0.3.7",
"description": "Make smile on your commits",
"keywords": [],
"homepage": "",
Expand Down Expand Up @@ -58,6 +58,7 @@
"bundle-declarations-webpack-plugin": "^5.0.0",
"chalk": "^5.3.0",
"clean-package": "^2.2.0",
"copy-webpack-plugin": "^12.0.1",
"eslint": "^8.56.0",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-pii": "^1.0.2",
Expand Down
123 changes: 123 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 784a9c1

Please sign in to comment.