Skip to content

Commit 9f27f1e

Browse files
test: Fixing function-loader tests
1 parent 7d591ac commit 9f27f1e

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
'prefer-destructuring': 0,
2222
'array-callback-return': 0,
2323
'prefer-template': 0,
24-
'class-methods-use-this': 0
24+
'class-methods-use-this': 0,
25+
'no-plusplus': 0
2526
}
2627
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extract-css-chunks-webpack-plugin",
3-
"version": "3.2.1-alpha.0",
3+
"version": "3.2.1-alpha.1",
44
"author": "James Gillmore <[email protected]>",
55
"contributors": [
66
"Zack Jackson <[email protected]> (https://github.com/ScriptedAlchemy)"

src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,6 @@ class ExtractCssChunks {
426426
this.traverseDepthFirst(rule, (node) => {
427427
if (node && node.use && Array.isArray(node.use)) {
428428
const isMiniCss = node.use.some((l) => {
429-
if (typeof l === 'function') {
430-
return false;
431-
}
432429
const needle = l.loader || l;
433430
if (typeof l === 'function') {
434431
return false;

src/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const pluginName = 'extract-css-chunks-webpack-plugin';
1212

1313
const exec = (loaderContext, code, filename) => {
1414
const module = new NativeModule(filename, loaderContext);
15-
module.paths = NativeModule._nodeModulePaths(loaderContext.context); // eslint-disable-line no-underscore-dangle
15+
// eslint-disable-line no-underscore-dangle
16+
module.paths = NativeModule._nodeModulePaths(loaderContext.context);
1617
module.filename = filename;
1718
module._compile(code, filename); // eslint-disable-line no-underscore-dangle
1819
return module.exports;

test/cases/function-loader/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import './style.css';
1+
import './main.css';
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
13
const Self = require('../../../');
24

35
module.exports = {
@@ -7,15 +9,17 @@ module.exports = {
79
{
810
test: /\.css$/,
911
use: [
10-
() => ({ loader: 'css-loader' }),
12+
() => [
13+
Self.loader,
14+
'css-loader',
15+
],
1116
],
1217
},
1318
],
1419
},
1520
plugins: [
1621
new Self({
1722
filename: '[name].css',
18-
hot: true,
1923
}),
2024
],
2125
};

0 commit comments

Comments
 (0)