Skip to content

Commit 7c11ae7

Browse files
committed
8.0.1
1 parent 2f04d18 commit 7c11ae7

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package-lock.json
55
*.result.css
66
.*
77
!.editorconfig
8+
!.gitattributes
89
!.gitignore
910
!.rollup.js
1011
!.tape.js

.rollup.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,33 @@ export default {
77
{ file: 'index.esm.mjs', format: 'esm', sourcemap: true, strict: false }
88
],
99
plugins: [
10+
patchBabelPluginSyntaxImportMeta(),
1011
babel({
1112
plugins: [
1213
['@babel/plugin-syntax-import-meta']
1314
],
1415
presets: [
1516
['@babel/preset-env', { modules: false, targets: { node: 8 } }]
1617
]
17-
}),
18-
patchBabelPluginSyntaxImportMeta()
18+
})
1919
]
2020
};
2121

2222
function patchBabelPluginSyntaxImportMeta () {
2323
return {
2424
name: 'patch-babel-plugin-syntax-import-meta',
25-
renderChunk (code) {
26-
const requireMatch = /new \(require\('u' \+ 'rl'\)\.URL\)/;
25+
renderChunk (code, chunk, options) {
26+
const currentUrlMatch = /var url = require\('url'\);([\W\w]+)const currentURL[^\n]+\nconst currentFilename[^\n]+/;
2727

28-
return code.replace(requireMatch, 'new url.URL');
28+
const shouldTransformImportMeta = options.format === 'cjs' && currentUrlMatch.test(code);
29+
30+
if (shouldTransformImportMeta) {
31+
const updatedCode = code.replace(currentUrlMatch, '$1const currentFilename = __filename;');
32+
33+
return updatedCode;
34+
}
35+
36+
return null;
2937
}
3038
};
3139
}

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
language: node_js
44

5+
os:
6+
- windows
7+
- linux
8+
- osx
9+
510
node_js:
611
- 8
712

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes to PostCSS Normalize
22

3+
### 8.0.1 (June 10, 2019)
4+
5+
- Fixed: Issue with Windows failing to resolve normalize
6+
- Updated: `browserslist` to 4.6.2 (patch)
7+
- Updated: `postcss` to 7.0.17 (patch)
8+
39
### 8.0.0 (June 3, 2019)
410

511
- Added: `sanitize.css` 10.0.0 (major)
@@ -27,9 +33,9 @@ versions of PostCSS to use PostCSS Normalize. This update resolves that.
2733

2834
### 5.0.0 (June 7, 2018)
2935

30-
- Update `browserslist` to v3.2.8 (major)
31-
- Update: `postcss` to v6.0.22 (patch)
32-
- Update: Node support from v4 to v6 (major)
36+
- Update `browserslist` to 3.2.8 (major)
37+
- Update: `postcss` to 6.0.22 (patch)
38+
- Update: Node support from v4 to 6 (major)
3339

3440
### 4.0.0 (June 21, 2017)
3541

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-normalize",
3-
"version": "8.0.0",
3+
"version": "8.0.1",
44
"description": "Use the parts of normalize.css or sanitize.css you need from your browserslist",
55
"author": "Jonathan Neal <jonathantneal@hotmail.com>",
66
"license": "CC0-1.0",
@@ -28,8 +28,8 @@
2828
},
2929
"dependencies": {
3030
"@csstools/normalize.css": "^10.1.0",
31-
"browserslist": "^4.6.1",
32-
"postcss": "^7.0.16",
31+
"browserslist": "^4.6.2",
32+
"postcss": "^7.0.17",
3333
"postcss-browser-comments": "^3.0.0",
3434
"sanitize.css": "^10.0.0"
3535
},
@@ -42,7 +42,7 @@
4242
"postcss-import": "^12.0.1",
4343
"postcss-tape": "^5.0.0",
4444
"pre-commit": "^1.2.2",
45-
"rollup": "^1.13.1",
45+
"rollup": "^1.14.6",
4646
"rollup-plugin-babel": "^4.3.2"
4747
},
4848
"eslintConfig": {

0 commit comments

Comments
 (0)