diff --git a/packages/webpack-plugin/lib/index.js b/packages/webpack-plugin/lib/index.js index 7c7fc8d78..0216e633e 100644 --- a/packages/webpack-plugin/lib/index.js +++ b/packages/webpack-plugin/lib/index.js @@ -54,13 +54,11 @@ const wxssLoaderPath = normalize.lib('wxss/index') const wxmlLoaderPath = normalize.lib('wxml/loader') const wxsLoaderPath = normalize.lib('wxs/loader') const styleCompilerPath = normalize.lib('style-compiler/index') -const styleStripConditaionalPath = normalize.lib('style-compiler/strip-conditional-loader') const templateCompilerPath = normalize.lib('template-compiler/index') const jsonCompilerPath = normalize.lib('json-compiler/index') const jsonThemeCompilerPath = normalize.lib('json-compiler/theme') const jsonPluginCompilerPath = normalize.lib('json-compiler/plugin') const extractorPath = normalize.lib('extractor') -const selectorPath = normalize.lib('selector') const async = require('async') const { parseQuery } = require('loader-utils') const stringifyLoadersAndResource = require('./utils/stringify-loaders-resource') @@ -1777,7 +1775,7 @@ try { }) const typeLoaderProcessInfo = { - styles: ['node_modules/css-loader', wxssLoaderPath, styleCompilerPath, styleStripConditaionalPath], + styles: ['node_modules/css-loader', wxssLoaderPath, styleCompilerPath], template: ['node_modules/html-loader', wxmlLoaderPath, templateCompilerPath] } @@ -1835,20 +1833,6 @@ try { loader: extractorPath }) } - if (type === 'styles') { - // 判断最后一个loader是否是 selectorPath, 如果是,则在sectorPath之前插入strip-conditional - const lastLoader = loaders[loaders.length - 1] - if (lastLoader.loader.includes(selectorPath)) { - loaders.splice(loaders.length - 1, 0, { - loader: styleStripConditaionalPath - }) - } else { - // 在最后一个插入strip-conditional - loaders.push({ - loader: styleStripConditaionalPath - }) - } - } createData.resource = addQuery(createData.resource, { mpx: MPX_PROCESSED_FLAG }, true) } // mpxStyleOptions 为 mpx style 文件的标识,避免 Vue 文件插入 styleCompiler 后导致 vue scoped 样式隔离失效