Skip to content

Commit

Permalink
feat: support css-loader ^6.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
meixg committed Sep 8, 2023
1 parent 6ad4930 commit d00951d
Show file tree
Hide file tree
Showing 12 changed files with 355 additions and 465 deletions.
5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"configurations": [
{
"args": [
"san-loader.test.ts"
// "san-loader.test.ts"
"index"
],
"name": "jest task",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
"type": "node"
},
{
"name": "Launch Program",
Expand Down
27 changes: 17 additions & 10 deletions examples/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
output: {
// filename: 'app/[name].js',
// // path: path.resolve(__dirname, './dist')
publicPath: 'https://www.baidu.com',
publicPath: 'https://www.baidu.com/',
clean: true
},
mode,
Expand Down Expand Up @@ -50,17 +50,16 @@ export default {
test: /.(less|css)$/,

oneOf: [
// 这里匹配 `<style lang="less" module>`
// 这里匹配 `<style lang="less">`
{
resourceQuery: /module/,
use: [
'style-loader',
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
modules: true,
sourceMap: true,
localsConvention: 'camelCase',
},
},
{
Expand All @@ -71,15 +70,19 @@ export default {
},
],
},
// 这里匹配 `<style lang="less">`
// 这里匹配 `<style lang="less" module>`
{
resourceQuery: /module/,
use: [
{
loader: 'style-loader',
},
'style-loader',
{
loader: 'css-loader',
options: {
esModule: false,
modules: {
exportLocalsConvention: 'camelCase',
namedExport: false,
},
sourceMap: true,
},
},
Expand Down Expand Up @@ -131,6 +134,10 @@ export default {
{
test: /\.html$/,
loader: 'html-loader',
options: {
esModule: false,
minimize: false,
}
},
],
},
Expand Down
Loading

0 comments on commit d00951d

Please sign in to comment.