提交 58cb0028 编写于 作者: fxy060608's avatar fxy060608

fix(v3): remove style loader (service)

上级 c01f7cfe
......@@ -110,6 +110,15 @@ const v3 = {
}]
})
if (isAppService) {
rules.push({
test: [/\.css$/, /\.p(ost)?css$/, /\.scss$/, /\.sass$/, /\.less$/, /\.styl(us)?$/],
use: [{
loader: path.resolve(__dirname, '../../packages/webpack-uni-app-loader/service/style.js')
}]
})
}
const entry = {}
if (isAppService) {
entry['app-service'] = path.resolve(process.env.UNI_INPUT_DIR, getMainEntry())
......@@ -281,6 +290,12 @@ const v3 = {
}
}
if (isAppService) { // service 层移除 css 相关
['css', 'postcss', 'scss', 'sass', 'less', 'stylus'].forEach(cssLang => {
webpackConfig.module.rules.delete(cssLang)
})
}
webpackConfig.plugins.delete('hmr')
webpackConfig.plugins.delete('html')
webpackConfig.plugins.delete('copy')
......
module.exports = function(source, map) {
console.warn(
`App平台 v3 模式暂不支持在 js 文件中引用"${this._module && this._module.rawRequest || this.resourcePath}"`
)
return ''
}
......@@ -103,7 +103,7 @@ module.exports = function(source, map) {
import 'uni-pages?${JSON.stringify({type:'view'})}'
function initView(){
${getStylesCode(this)}
injectStyles()
typeof injectStyles ==='function' && injectStyles()
${getDefineComponents(parseComponents(source, traverse)).join('\n')}
UniViewJSBridge.publishHandler('webviewReady')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册