Skip to content

Commit c8ce306

Browse files
committed
- chore: up version for npm after PR with suppoerts for TS
1 parent 2ef5352 commit c8ce306

File tree

3 files changed

+105
-83
lines changed

3 files changed

+105
-83
lines changed

CHANGELOG.md

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,90 @@
1-
## 0.8.0 (2022-04-01) The last stable version
2-
- added new option `remove` to define custom RegExp for generated assets that must be removed
3-
- update packages
1+
## 0.8.1 (2022-06-14)
2+
- fix: add supports for TypeScript
3+
- chore: update packages
4+
- docs: update readme
5+
6+
## 0.8.0 (2022-04-01)
7+
- feat: added new option `remove` to define custom RegExp for generated assets that must be removed
8+
- chore: update packages
49

510
## 0.7.3 (2022-01-30)
611
- added color verbose output via ANSI color library - ansis
712
- added the test case for styles imported from javascript
813

914
## 0.7.2 (2021-12-13)
10-
- added new option `enable` to enable / disable the plugin, e.g. by development
11-
- added supports of `RegExp` for option `extensions`
12-
- remove deprecated option `silent`, use `verbose` to show process information (no braking change)
13-
- added GitHub workflow + codecov
14-
- update packages
15-
- update readme
15+
- feat: added new option `enable` to enable / disable the plugin, e.g. by development
16+
- feat: added supports of `RegExp` for option `extensions`
17+
- chore: remove deprecated option `silent`, use `verbose` to show process information (no braking change)
18+
- chore: add GitHub workflow + codecov
19+
- chore: update packages
20+
- docs: update readme
1621

1722
## 0.7.1 (2021-01-14)
18-
### Bugfixes
19-
- fix the issue infinite recursion by collect of resources from dependency modules by usage in react app some big components with many thousands dependencies
23+
- fix: the issue infinite recursion by collect of resources from dependency modules by usage in react app some big components with many thousands dependencies
2024

2125
## 0.7.0 (2020-12-21)
22-
### Breaking change
23-
- deprecate the `silent` option, it will be removed on Juni 30, 2021. Use option `verbose: true` to show in console each removed empty file. Defaults, `verbose: false`.
24-
25-
### Bugfixes
26-
- fix issue `Maximum call stack size exceeded` in all cases, for example, by usage the webpack setting `optimization.concatenateModules: true` and:
26+
- chore: deprecate the `silent` option, it will be removed on Juni 30, 2021. Use option `verbose: true` to show in console each removed empty file.
27+
Defaults, `verbose: false`.
28+
- fix: issue `Maximum call stack size exceeded` in all cases, for example, by usage the webpack setting `optimization.concatenateModules: true` and:
2729
- import react
2830
- import redux
2931
- webpack setting `externals.jquery: 'jQuery'` or other external libs
30-
- The issue if first in webpack entries are a styles and then a scripts.
32+
- fix: the issue if first in webpack entries are a styles and then a scripts
3133

3234
## 0.6.4 (2020-12-19)
33-
- fix the error: `Maximum call stack size exceeded` with webpack setting `optimization.concatenateModules: true`and usage in script imports from `react` and `redux`
34-
- added the test case for single style without a scripts in webpack config
35-
- added silent mode in tests to suppress output log info in the console
36-
- improve the option `ignore`:
35+
- feat: improve the option `ignore`:
3736
- it can be the array of string or RegExp
3837
- added default value of `ignore` as `['/node_modules/']` to ignore resources from `node_modules` path
39-
- update npm packages.
38+
- fix: the error: `Maximum call stack size exceeded` with webpack setting `optimization.concatenateModules: true`and usage in script imports from `react` and `redux`
39+
- test: added the test case for single style without a scripts in webpack config
40+
- test: added silent mode in tests to suppress output log info in the console
41+
- chore: update packages
4042

4143
## 0.6.3 (2020-10-25)
42-
- fix BREAKING CHANGE in Webpack 5: no more changes should happen to `Compilation.assets`
43-
- update code accord new API
44+
- fix: BREAKING CHANGE in Webpack 5: no more changes should happen to `Compilation.assets`
45+
- refactor: update code according Webpack 5 API
4446

4547
## 0.6.2 (2020-10-24)
46-
Update npm packages.
48+
- chore: update packages
4749

4850
## 0.6.1 (2020-10-20)
49-
The fork of original [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries) (ver. 0.6.0) for support only Webpack 5 and above.
50-
The Webpack 4 is no longer supported.
51+
- The fork of original [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries) (ver. 0.6.0) for support only Webpack 5 and above.
52+
The Webpack 4 is no longer supported.
5153

5254
### The changes from original version 0.6.0:
5355

54-
- feature: considers the use hash after the .js and .mjs extension in file format like `.js?[hash]` or `.mjs?[hash]`.
55-
The idea and requirement belong to [MatiasMorici](https://github.com/MatiasMorici) from [PR](https://github.com/fqborges/webpack-fix-style-only-entries/pull/27/commits/57eeecbcb85926578770c3845465e4012b02a196)
56-
- In Webpack 5 fixed deprecation messages:
56+
- feat: considers the use hash after the .js and .mjs extension in file format like `.js?[hash]` or `.mjs?[hash]`.
57+
The idea and requirement belong to [MatiasMorici](https://github.com/MatiasMorici) from [PR](https://github.com/fqborges/webpack-fix-style-only-entries/pull/27/commits/57eeecbcb85926578770c3845465e4012b02a196)
58+
- fix: in Webpack 5 fixed deprecation messages:
5759
- DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE
5860
- DEP_WEBPACK_CHUNK_ENTRY_MODULE
5961
- DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET
6062
- DEP_WEBPACK_MODULE_INDEX
6163

62-
- update all packages for Webpack 5.
63-
- fix integration test script for using with Webpack 5.
64-
- fix a BUG of `terser-webpack-plugin` (generate the futile file `vendor.js.LICENSE.txt`) in the production test `vendor+multi-js-entry-css-entry`.
65-
- fix module structure in README.md.
64+
- fix: integration test script for using with Webpack 5
65+
- fix: issue using `terser-webpack-plugin` is generated the needless file `vendor.js.LICENSE.txt` in the production test `vendor+multi-js-entry-css-entry`
66+
- docs: corrected module structure in README.md
67+
- chore: update packages
6668

6769
## 0.6.0 (Oct 13, 2020)
68-
Being overly careful here, this version is not breaking for almost all the existing users. It could possibly break in some edge cases, since it changes how modules are collected (from global to one each compilation) or if you have a workaround for a working webpack multi configuration.
69-
- BREAKING (POSSIBLY): Use a dedicated cache for every compilation (Prevent arbitrary files deletion when using Webpack with multi configurations) (PR [#39](https://github.com/fqborges/webpack-fix-style-only-entries/pull/39))
70+
Being overly careful here, this version is not breaking for almost all the existing users.
71+
It could possibly break in some edge cases, since it changes how modules are collected (from global to one each compilation)
72+
or if you have a workaround for a working webpack multi configuration.
73+
- BREAKING POSSIBLY: Use a dedicated cache for every compilation (Prevent arbitrary files deletion when using Webpack with multi configurations) (PR [#39](https://github.com/fqborges/webpack-fix-style-only-entries/pull/39))
7074

7175
## 0.5.2 (Oct 07, 2020)
72-
- supports Webpack 5 using ModuleGraph API (PR [#38](https://github.com/fqborges/webpack-fix-style-only-entries/pull/38))
73-
- npm audit fix: ([ea9dd7](https://github.com/fqborges/webpack-fix-style-only-entries/commit/ea9dd7bd7ade5b16623064a4850de39545e1e18e))
76+
- feat: supports Webpack 5 using ModuleGraph API (PR [#38](https://github.com/fqborges/webpack-fix-style-only-entries/pull/38))
77+
- chore: npm audit fix: ([ea9dd7](https://github.com/fqborges/webpack-fix-style-only-entries/commit/ea9dd7bd7ade5b16623064a4850de39545e1e18e))
7478

7579
## 0.5.1 (Jun 13, 2020)
76-
- fix Maximum call stack size exceeded (PR [#34](https://github.com/fqborges/webpack-fix-style-only-entries/pull/34))
77-
- added CHANGELOG ([3e3767](https://github.com/fqborges/webpack-fix-style-only-entries/commit/3e3767d8998a53d807b5d5b10643d05b800aa79a))
80+
- fix: Maximum call stack size exceeded (PR [#34](https://github.com/fqborges/webpack-fix-style-only-entries/pull/34))
81+
- chore: add CHANGELOG ([3e3767](https://github.com/fqborges/webpack-fix-style-only-entries/commit/3e3767d8998a53d807b5d5b10643d05b800aa79a))
7882

7983
## 0.5.0 (May 18, 2020)
80-
- fix for [#23](https://github.com/fqborges/webpack-fix-style-only-entries/issues/23) ([37d350](https://github.com/fqborges/webpack-fix-style-only-entries/commit/37d350eec83f49c0b12729a93aa6cf2f96d92d0b))
81-
- fix for [#24](https://github.com/fqborges/webpack-fix-style-only-entries/issues/24) ([d92bec](https://github.com/fqborges/webpack-fix-style-only-entries/commit/d92bec4be5fe4b97a8651a9206fa2281ce1424be))
82-
- BREAKING: added styl and sass to default extensions ([247a5c](https://github.com/fqborges/webpack-fix-style-only-entries/commit/247a5c9f963e4d7598539056ab3f709b0558b4ec))
83-
- added LICENSE.txt ([220e20](https://github.com/fqborges/webpack-fix-style-only-entries/commit/220e20eeb9bc95652a942812a424aadd92ec7d1f))
84+
- BREAKING CHANGE: added styl and sass to default extensions ([247a5c](https://github.com/fqborges/webpack-fix-style-only-entries/commit/247a5c9f963e4d7598539056ab3f709b0558b4ec))
85+
- fix: for [#23](https://github.com/fqborges/webpack-fix-style-only-entries/issues/23) ([37d350](https://github.com/fqborges/webpack-fix-style-only-entries/commit/37d350eec83f49c0b12729a93aa6cf2f96d92d0b))
86+
- fix: for [#24](https://github.com/fqborges/webpack-fix-style-only-entries/issues/24) ([d92bec](https://github.com/fqborges/webpack-fix-style-only-entries/commit/d92bec4be5fe4b97a8651a9206fa2281ce1424be))
87+
- chore: add LICENSE.txt ([220e20](https://github.com/fqborges/webpack-fix-style-only-entries/commit/220e20eeb9bc95652a942812a424aadd92ec7d1f))
8488

8589
## 0.4.0 (Sep 8, 2019)
8690
- feat: add support for module js files (PR [#21](https://github.com/fqborges/webpack-fix-style-only-entries/pull/21))

README.md

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![npm](https://img.shields.io/npm/v/webpack-remove-empty-scripts/latest?logo=npm&color=brightgreen "npm package")](https://www.npmjs.com/package/webpack-remove-empty-scripts/v/0.8.0)
1+
[![npm](https://img.shields.io/npm/v/webpack-remove-empty-scripts/latest?logo=npm&color=brightgreen "npm package")](https://www.npmjs.com/package/webpack-remove-empty-scripts/v/0.8.1)
22
[![node](https://img.shields.io/node/v/webpack-remove-empty-scripts)](https://nodejs.org)
33
[![node](https://img.shields.io/github/package-json/dependency-version/webdiscus/webpack-remove-empty-scripts/peer/webpack)](https://webpack.js.org/)
44
[![codecov](https://codecov.io/gh/webdiscus/webpack-remove-empty-scripts/branch/master/graph/badge.svg)](https://codecov.io/gh/webdiscus/webpack-remove-empty-scripts)
@@ -39,49 +39,58 @@ You can find more info by the following issues:
3939
- [extract-text-webpack-plugin issue](https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/518)
4040
- [mini-css-extract-plugin issue](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151)
4141

42-
## NEW
43-
> The `experimental` version `^1.x.x` has **_new improved and fast algorithm_** to detect generated needless empty js files.\
44-
> Please test your project before using it in production.\
45-
> If you have a problem with the new version, please create a [new issue](https://github.com/webdiscus/webpack-remove-empty-scripts/issues).
46-
47-
> :warning: The last stable release is `0.8.0` in the branch [`master`](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/master).
48-
49-
## Propose
50-
If you use the `mini-css-extract-plugin` only to extract `css` files from styles defined in webpack entry
51-
like `scss` `sass` `less` `stylus` then try to use **new entry extract plugin** - [pug-plugin](https://github.com/webdiscus/pug-plugin).
42+
---
5243

53-
The `pug-plugin`:
44+
## Usage with Pug
5445

55-
- extract HTML and CSS from `pug` `html` `scss` resources defined in `webpack entry`
56-
- doesn't need any fix plugins like `webpack-remove-empty-scripts`, because it doesn't generate empty `js` files
57-
- is very flexible and fast
46+
If you use Pug with this plugin, then you should use the [pug-plugin](https://github.com/webdiscus/pug-plugin).<br>
47+
Pug plugin enable using Pug files directly in webpack entry.<br>
48+
Pug plugin extract JavaScript and CSS from sources used in Pug.
5849

59-
Improve performance with `pug-plugin`. Using the `pug-plugin` for `pug` `html` `scss` etc in the `webpack entry` no longer requires additional plugins such as:
60-
- [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin)
61-
- [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin)
62-
- [webpack-remove-empty-scripts](https://github.com/webdiscus/webpack-remove-empty-scripts) (bug fix plugins for `mini-css-extract-plugin`)
63-
- [pug-loader](https://github.com/webdiscus/pug-loader) (this loader is already included in the `pug-plugin`)
50+
> 💡Using `pug-plugin` the entry-point is the Pug template, not a JS file.
6451
65-
For example, `webpack.config.js`
52+
Define Pug files in webpack entry:
6653
```js
6754
const PugPlugin = require('pug-plugin');
6855
module.exports = {
6956
entry: {
70-
'main': 'main.js',
71-
'styles': 'styles.scss',
72-
'index': 'index.html', // now is possible define HTML file in entry
73-
'page01': 'page01.pug', // now is possible define PUG file in entry
74-
// ...
57+
// all sources of scripts and styles can be used directly in Pug
58+
// here should be defined Pug templates only
59+
index: './src/views/index.pug', // output index.html
60+
about: './src/views/about/index.pug' // output about.html
61+
// ..
7562
},
7663
plugins: [
77-
new PugPlugin(), // supports zero config using default webpack output options
78-
]
64+
// enable using Pug files in webpack entry
65+
new PugPlugin({
66+
modules: [
67+
// enable extract CSS from source of styles used in Pug
68+
PugPlugin.extractCss({
69+
// output filename of styles
70+
filename: 'assets/css/[name].[contenthash:8].css',
71+
}),
72+
],
73+
}),
74+
],
7975
// ...
8076
};
8177
```
82-
> The plugin can be used not only for `pug` but also for simply extracting `HTML` or `CSS` from `webpack entry`, independent of pug usage.
78+
Use source files of styles and scripts directly in Pug:
79+
```pug
80+
link(href=require('./styles.scss') rel='stylesheet')
81+
script(src=require('./main.js'))
82+
```
83+
Generated HTML contains hashed CSS and JS output filenames:
84+
```html
85+
<link href="/assets/css/styles.05e4dd86.css" rel="stylesheet">
86+
<script src="/assets/js/main.f4b855d8.js"></script>
87+
```
8388

84-
For more examples see the [pug-plugin](https://github.com/webdiscus/pug-plugin).
89+
You don't need anymore to use `html-webpack-plugin` `mini-css-extract-plugin` `webpack-remove-empty-scripts` and `pug-loader`.
90+
The single `pug-plugin` replaces all most used functions of these plugins and loaders.
91+
Keep your webpack config clear and clean.
92+
93+
---
8594

8695
## Install
8796
```console
@@ -199,6 +208,15 @@ new RemoveEmptyScriptsPlugin({
199208
`npm run test` will run the unit and integration tests.\
200209
`npm run test:coverage` will run the tests with coverage.
201210

211+
## New experimental version
212+
213+
> The `experimental` version `^1.x.x` has **_new improved and fast algorithm_** to detect generated needless empty js files.\
214+
> Please test your project before using it in production.\
215+
> If you have a problem with the new version, please create a [new issue](https://github.com/webdiscus/webpack-remove-empty-scripts/issues).
216+
217+
> ⚠️ The last stable release is `0.8.x` in the branch [`master`](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/master).
218+
219+
202220
## Also See
203221

204222
- more examples of usages see in [test cases](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/master/test/cases)

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-remove-empty-scripts",
3-
"version": "0.8.0",
3+
"version": "0.8.1",
44
"description": "Webpack 5 plugin to remove empty scripts generated by usage only style in webpack entry.",
55
"keywords": [
66
"webpack",
@@ -65,21 +65,21 @@
6565
"webpack": ">=5.32.0"
6666
},
6767
"dependencies": {
68-
"ansis": "^1.3.4"
68+
"ansis": "^1.3.6"
6969
},
7070
"devDependencies": {
71-
"@babel/core": "^7.17.8",
72-
"@babel/preset-env": "^7.16.11",
73-
"@types/jest": "^27.4.1",
71+
"@babel/core": "^7.18.5",
72+
"@babel/preset-env": "^7.18.2",
73+
"@types/jest": "^28.1.1",
7474
"css-loader": "^6.7.1",
7575
"fs": "^0.0.1-security",
7676
"html-loader": "^3.1.0",
77-
"jest": "^27.5.1",
77+
"jest": "^28.1.1",
7878
"mini-css-extract-plugin": "^2.6.0",
79-
"moment": "^2.29.1",
79+
"moment": "^2.29.3",
8080
"rimraf": "^3.0.2",
81-
"terser-webpack-plugin": "^5.3.1",
82-
"webpack": "^5.70.0",
81+
"terser-webpack-plugin": "^5.3.3",
82+
"webpack": "^5.73.0",
8383
"webpack-hot-middleware": "^2.25.1",
8484
"webpack-merge": "^5.8.0"
8585
}

0 commit comments

Comments
 (0)