微信小程序

优质
小牛编辑
148浏览
2023-12-01

@megalo/targetplatform 设置成 wechatmini-css-extract-plugin 提取文件后缀改成微信小程序的 wxss

const createMegaloTarget = require( '@megalo/target' )
const compiler = require( '@megalo/template-compiler' )
const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' )

module.exports = {
  target: createMegaloTarget( {
    compiler,
    platform: 'wechat'
  } ),

  plugins: [
    new MiniCssExtractPlugin( {
      filename: 'static/css/[name].wxss',
    } )
    // ...
  ]

  // ... 其他配置
}