Skip to content

Commit ed26438

Browse files
committed
[fix] compatibility for npm@4
1 parent b4fe216 commit ed26438

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/getWebpackConfig.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,20 @@ export default function (source, asset, dest, cwd, tpl, config) {
6666
if (i.loader) {
6767
return {
6868
...i,
69-
loader: i.loader.replace(/^.*extract-text-webpack-plugin\/loader.js((?!!).)*!/, 'style!'),
69+
loader: i.loader.replace(
70+
/^.*extract-text-webpack-plugin(@\d+(\.\d+)+)?\/loader.js((?!!).)*!/,
71+
'style!'
72+
),
7073
};
7174
}
7275
if (i.loaders) {
7376
return {
7477
...i,
7578
loaders: i.loaders.map(item =>
76-
item.replace(/^.*extract-text-webpack-plugin\/loader.js((?!!).)*!/, 'style!')
79+
item.replace(
80+
/^.*extract-text-webpack-plugin(@\d+(\.\d+)+)?\/loader.js((?!!).)*!/,
81+
'style!'
82+
),
7783
),
7884
};
7985
}

0 commit comments

Comments
 (0)