Skip to content

Commit

Permalink
feat: support function for loader sunch as css-loader #58
Browse files Browse the repository at this point in the history
  • Loading branch information
BUPTlhuanyu committed Dec 19, 2021
1 parent 2e1dfff commit fd8992a
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 17,273 deletions.
12 changes: 12 additions & 0 deletions example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = (env = {}) => {
poolTimeout: env.watch ? Infinity : 2000,
};
const workerPoolSass = {
workerAllowedFunctions: ['cssLoaderGetLocalIdent'],
workers: +env.threads,
workerParallelJobs: 2,
poolTimeout: env.watch ? Infinity : 2000,
Expand Down Expand Up @@ -50,6 +51,17 @@ module.exports = (env = {}) => {
loader: path.resolve(__dirname, '../dist/index.js'),
options: workerPoolSass,
},
{
loader: 'css-loader',
options: {
modules: {
getLocalIdent: function cssLoaderGetLocalIdent() {
console.log('getLocalIdent called');
return null;
},
},
},
},
'css-loader',
'sass-loader',
].filter(Boolean),
Expand Down

0 comments on commit fd8992a

Please sign in to comment.