Skip to content

Commit 5ebaa16

Browse files
davidhouwelingjantimon
authored andcommitted
feat(postcss-plugin.js): update for css-loader@4
css-loader@4 introduced a breaking change which meant the use of `~` needs to be relocated from before the `!!` to after the loader use + `!` BREAKING CHANGE: this change requires css-loader@4 to work, earlier versions of css-loader should use previous version re #46
1 parent 337f38c commit 5ebaa16

File tree

7 files changed

+5683
-4005
lines changed

7 files changed

+5683
-4005
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: node_js
22
node_js:
3-
- 6
4-
- 8
53
- 10
4+
- 12
65
before_install:
76
- stty columns 120
87
install:

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ This plugin requires:
1919
+ webpack 3.x or higher
2020
+ postcss-loader 2.x or higher
2121
+ node 6 or higher
22-
+ css-loader 2.x or higher
22+
+ css-loader 3.x or higher
2323

2424
## Installation
2525

26-
```
26+
```bash
2727
npm i --save-dev postcss-loader
2828
npm i --save-dev iconfont-webpack-plugin
2929
```
@@ -84,7 +84,6 @@ const IconfontWebpackPlugin = require('iconfont-webpack-plugin');
8484
resolve: loader.resolve,
8585
fontNamePrefix: 'custom-',
8686
enforcedSvgHeight: 3000,
87-
modules: false,
8887
})
8988
]
9089
}

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
environment:
55
matrix:
6-
- nodejs_version: 6
6+
- nodejs_version: 10
77

88
version: "{build}"
99
build: off

lib/postcss-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ function addFontDeclaration (fontName, postCssRoot, enforcedSvgHeight, svgPaths)
158158
const iconFontLoaderPath = path.join(iconFontPluginDirectory, 'lib/loader.js').replace(/\\/g, '/');
159159
const iconFontPlaceholderPath = path.join(iconFontPluginDirectory, 'placeholder.svg').replace(/\\/g, '/');
160160
// Use !! to tell webpack that we don't want any other loader to kick in
161-
const url = '~!!' + iconFontLoaderPath + '?' + JSON.stringify(options) + '!' + iconFontPlaceholderPath;
161+
const url = '!!' + iconFontLoaderPath + '?' + JSON.stringify(options) + '!~' + iconFontPlaceholderPath;
162162
postCssRoot.prepend(postcss.parse(
163163
'@font-face { ' +
164164
'font-family: ' + fontName + '; src:url(\'' + url + '\') format(\'woff\');' +

0 commit comments

Comments
 (0)