Skip to content

Commit

Permalink
rm useless files & fix loader match
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyuki committed Sep 15, 2023
1 parent cd1f38b commit 88716d3
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 516 deletions.
10 changes: 5 additions & 5 deletions packages/webpack-plugin/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,8 +1453,8 @@ try {
})

const typeLoaderProcessInfo = {
styles: ['css-loader', wxssLoaderPath, styleCompilerPath],
template: ['html-loader', wxmlLoaderPath, templateCompilerPath]
styles: ['node_modules/css-loader', wxssLoaderPath, styleCompilerPath],
template: ['node_modules/html-loader', wxmlLoaderPath, templateCompilerPath]
}

// 应用过rules后,注入mpx相关资源编译loader
Expand Down Expand Up @@ -1517,15 +1517,15 @@ try {
if (mpx.mode === 'web') {
const mpxStyleOptions = queryObj.mpxStyleOptions
const firstLoader = loaders[0] ? toPosix(loaders[0].loader) : ''
const isPitcherRequest = firstLoader.includes('vue-loader/lib/loaders/pitcher')
const isPitcherRequest = firstLoader.includes('node_modules/vue-loader/lib/loaders/pitcher')
let cssLoaderIndex = -1
let vueStyleLoaderIndex = -1
let mpxStyleLoaderIndex = -1
loaders.forEach((loader, index) => {
const currentLoader = toPosix(loader.loader)
if (currentLoader.includes('css-loader') && cssLoaderIndex === -1) {
if (currentLoader.includes('node_modules/css-loader') && cssLoaderIndex === -1) {
cssLoaderIndex = index
} else if (currentLoader.includes('vue-loader/lib/loaders/stylePostLoader') && vueStyleLoaderIndex === -1) {
} else if (currentLoader.includes('node_modules/vue-loader/lib/loaders/stylePostLoader') && vueStyleLoaderIndex === -1) {
vueStyleLoaderIndex = index
} else if (currentLoader.includes(styleCompilerPath) && mpxStyleLoaderIndex === -1) {
mpxStyleLoaderIndex = index
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = (loaders, loaderIndex) => {
for (let i = loaderIndex; i >= 0; i--) {
const currentLoader = loaders[i]
if (currentLoader.path.endsWith('ts-loader/dist/stringify-loader.js')) {
if (currentLoader.path.endsWith('node_modules/ts-loader/dist/stringify-loader.js')) {
return i
}
}
Expand Down
52 changes: 0 additions & 52 deletions packages/webpack-plugin/lib/wxss/compile-exports.js

This file was deleted.

36 changes: 0 additions & 36 deletions packages/webpack-plugin/lib/wxss/createResolver.js

This file was deleted.

79 changes: 0 additions & 79 deletions packages/webpack-plugin/lib/wxss/css-base.js

This file was deleted.

25 changes: 0 additions & 25 deletions packages/webpack-plugin/lib/wxss/getLocalIdent.js

This file was deleted.

44 changes: 0 additions & 44 deletions packages/webpack-plugin/lib/wxss/localsLoader.js

This file was deleted.

Loading

0 comments on commit 88716d3

Please sign in to comment.