Skip to content

Commit ddaa5c7

Browse files
author
Gerald Yeo
authored
Merge pull request #2 from yeojz/feature/webpack-4-support
Webpack 4 Support + Update Dependencies
2 parents e81d9d3 + cc37eb9 commit ddaa5c7

12 files changed

Lines changed: 11135 additions & 4699 deletions

.babelrc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"presets": [
3-
"es2015"
4-
],
5-
"plugins": [
6-
],
7-
"env": {
8-
}
3+
["env", {
4+
"targets": {
5+
"node": "6"
6+
}
7+
}]
8+
]
99
}

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.nycrc
88
.spec_output
99
.travis.yml
10+
.npmrc
1011

1112
/rollup.config.js
1213
/webpack.config.js
@@ -21,3 +22,4 @@ tests
2122
webpack.config.js
2223
temp
2324
fixtures
25+

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ Before submitting a pull request, please make sure the following is done:
4444

4545
Thank you for contributing!
4646

47-
[pr-welcome-badge]: https://img.shields.io/badge/PRs-Welcome-ff69b4.svg?style=flat-square
47+
[pr-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
4848
[pr-welcome-link]: https://github.com/yeojz/filter-chunk-webpack-plugin/blob/master/CONTRIBUTING.md

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
[![npm][npm-badge]][npm-link]
66
[![Build Status][circle-badge]][circle-link]
7+
[![Coverage Status][codecov-badge]][codecov-link]
8+
[![PRs Welcome][pr-welcome-badge]][pr-welcome-link]
79

810
This webpack plugin allows you to filter the list of output files before
911
they are being written / emitted to disk. It does not prevent files
@@ -21,11 +23,19 @@ Install the library via:
2123
$ npm install filter-chunk-webpack-plugin --save-dev
2224
```
2325

26+
### Tested Versions
27+
28+
| Webpack | Package Version |
29+
| ------- | --------------- |
30+
| 4.x.x | > 2.x.x |
31+
| 3.x.x | 1.x.x |
32+
2433
## Basic Usage
2534

2635
```js
27-
const FilterChunkWebpackPlugin = require('filter-chunk-webpack-plugin');
2836
const ExtractTextPlugin = require('extract-text-webpack-plugin');
37+
const FilterChunkWebpackPlugin = require('filter-chunk-webpack-plugin');
38+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2939
const path = require('path');
3040

3141
const webpackConfig = {
@@ -36,6 +46,12 @@ const webpackConfig = {
3646
},
3747
module: {
3848
rules: [{
49+
test: /\.css$/,
50+
use: [
51+
MiniCssExtractPlugin.loader,
52+
"css-loader"
53+
]
54+
}, {
3955
test: /\.svg$/,
4056
use: {
4157
loader: 'file-loader',
@@ -47,10 +63,10 @@ const webpackConfig = {
4763
}]
4864
},
4965
plugins: [
50-
new ExtractTextPlugin({
51-
filename: 'assets/css/css.[contenthash].css',
52-
allChunks: true
53-
}),
66+
new MiniCssExtractPlugin({
67+
filename: "assets/css/[contenthash].css",
68+
chunkFilename: "assets/css/[id].css"
69+
})
5470
new FilterChunkWebpackPlugin({
5571
patterns: [
5672
'assets/*',
@@ -74,7 +90,7 @@ but not
7490
assets/images/a5b912cd3.svg
7591
```
7692

77-
For more info, check out the [usage.spec.js](./src/usage.spec.js) for more info.
93+
For more information, check out the [usage.spec.js](./src/usage.spec.js).
7894

7995
## Options
8096

@@ -89,8 +105,10 @@ For more info, check out the [usage.spec.js](./src/usage.spec.js) for more info.
89105

90106
[npm-badge]: https://img.shields.io/npm/v/filter-chunk-webpack-plugin.svg?style=flat-square
91107
[npm-link]: https://www.npmjs.com/package/filter-chunk-webpack-plugin
92-
93108
[circle-badge]: https://img.shields.io/circleci/project/github/yeojz/filter-chunk-webpack-plugin/master.svg?style=flat-square
94109
[circle-link]: https://circleci.com/gh/yeojz/filter-chunk-webpack-plugin
95-
96110
[multimatch-package]: https://github.com/sindresorhus/multimatch
111+
[pr-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
112+
[pr-welcome-link]: https://github.com/yeojz/filter-chunk-webpack-plugin/blob/master/CONTRIBUTING.md
113+
[codecov-badge]: https://img.shields.io/codecov/c/github/yeojz/filter-chunk-webpack-plugin/master.svg?style=flat-square
114+
[codecov-link]: https://codecov.io/gh/yeojz/filter-chunk-webpack-plugin

circle.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
machine:
22
node:
3-
version: "6"
3+
version: "8"
44
environment:
55
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
66
general:
77
branches:
88
ignore:
99
- gh-pages
10-
dependencies:
11-
override:
12-
- yarn
13-
cache_directories:
14-
- ~/.cache/yarn
1510
test:
1611
pre:
1712
- yarn run clean
1813
override:
19-
- yarn test
20-
- yarn run lint
21-
- yarn run test
22-
- yarn run coverage:upload
14+
- npm run test
15+
- npm run lint
16+
- npm run test
17+
- npm run coverage:upload
2318
deployment:
2419
release:
2520
tag: /^v[0-9]+(\.[0-9]+)*$/
2621
owner: yeojz
2722
commands:
28-
- yarn run clean
29-
- yarn run build
30-
- echo -e "$NPM_USER\n$NPM_PASS\n$NPM_EMAIL" | npm login
23+
- npx conventional-github-releaser -p angular
24+
- npm run clean
25+
- npm run build
3126
- npm publish
32-
- npm logout
27+
beta:
28+
tag: /^v[0-9]+(\.[0-9]+)*\-[0-9]+$/
29+
owner: yeojz
30+
commands:
31+
- npx conventional-github-releaser -p angular
32+
- npm run clean
33+
- npm run build
34+
- npm publish --tag next
35+

0 commit comments

Comments
 (0)