Skip to content

Commit 53d5aed

Browse files
committed
feat: support function for loader sunch as css-loader #58
1 parent 2e1dfff commit 53d5aed

File tree

5 files changed

+78
-17273
lines changed

5 files changed

+78
-17273
lines changed

example/webpack.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = (env = {}) => {
1212
poolTimeout: env.watch ? Infinity : 2000,
1313
};
1414
const workerPoolSass = {
15+
workerAllowedFunctions: ['cssLoaderGetLocalIdent'],
1516
workers: +env.threads,
1617
workerParallelJobs: 2,
1718
poolTimeout: env.watch ? Infinity : 2000,
@@ -50,6 +51,17 @@ module.exports = (env = {}) => {
5051
loader: path.resolve(__dirname, '../dist/index.js'),
5152
options: workerPoolSass,
5253
},
54+
{
55+
loader: 'css-loader',
56+
options: {
57+
modules: {
58+
getLocalIdent: function cssLoaderGetLocalIdent() {
59+
console.log('getLocalIdent called');
60+
return null;
61+
},
62+
},
63+
},
64+
},
5365
'css-loader',
5466
'sass-loader',
5567
].filter(Boolean),

0 commit comments

Comments
 (0)