Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: 2.4.4 #203

Merged
merged 15 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## 2.4.4 (2023-06-14)

### Features

- 添加 `cssChildCombinatorReplaceValue` 配置项,允许用户自定义直接子代选择器行为
- 更精细化的处理了 css 选择器的转义逻辑

## 2.4.3 (2023-06-10)

### Fixed
Expand Down
22 changes: 18 additions & 4 deletions demo/taro-app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ if (isLocal) {
UnifiedWebpackPluginV5 = plugin
}
const config = {
compiler: 'webpack5',
compiler: {
prebundle: {
enable: false,
},
type: 'webpack5'
},
projectName: 'myApp',
date: '2022-2-5',
designWidth: 750,
Expand All @@ -37,7 +42,9 @@ const config = {
postcss: {
pxtransform: {
enable: true,
config: {}
config: {
selectorBlackList: ['shadow']
}
},
url: {
enable: true,
Expand All @@ -55,15 +62,22 @@ const config = {
// tailwindcss: {},
// autoprefixer: {},
},
/**
*
* @param {import('webpack-chain')} chain
* @param {import('webpack')} webpack
*/
webpackChain(chain, webpack) {

const opt = {
appType: 'taro',
minifiedJs:true
minifiedJs: true
// customAttributes: {
// // '*': ['emptyImageClass','btnClassName'],
// '*': [/Class/]
// }
}

// chain.merge({
// plugin: {
// install: {
Expand All @@ -77,7 +91,7 @@ const config = {
plugin: {
install: {
plugin: UnifiedWebpackPluginV5,
args: [opt, 'taro']
// args: [opt, 'taro']
}
}
})
Expand Down
15 changes: 8 additions & 7 deletions demo/taro-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,30 @@
],
"author": "",
"dependencies": {
"@babel/runtime": "^7.22.3",
"@babel/runtime": "^7.22.5",
"@tarojs/components": "3.6.7",
"@tarojs/react": "3.6.7",
"@tarojs/runtime": "3.6.7",
"@tarojs/taro": "3.6.7",
"antd-mobile": "^5.30.0",
"antd-mobile": "^5.31.0",
"classnames": "^2.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"taro-hooks": "1.5.10"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@babel/core": "^7.22.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@tarojs/cli": "3.6.7",
"@tarojs/mini-runner": "3.6.7",
"@tarojs/plugin-framework-react": "^3.6.7",
"@tarojs/plugin-platform-h5": "^3.6.7",
"@tarojs/webpack-runner": "3.6.7",
"@tarojs/webpack5-runner": "3.6.7",
"@types/react": "^18.2.8",
"@types/react": "^18.2.12",
"@types/webpack-env": "^1.18.1",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"autoprefixer": "^10.4.14",
"babel-plugin-import": "^1.13.6",
"babel-preset-taro": "3.6.7",
Expand All @@ -84,7 +84,8 @@
"weapp-ide-cli": "^1.0.1",
"weapp-tailwindcss-children": "^0.1.0",
"weapp-tailwindcss-webpack-plugin": "^2.4.3",
"webpack": "^5.86.0"
"webpack": "^5.86.0",
"webpack-chain": "^6.5.1"
},
"engines": {
"node": ">=12.0.0"
Expand Down
14 changes: 14 additions & 0 deletions demo/taro-app/project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "普通分包",
"pathName": "moduleA/pages/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "独立分包",
"pathName": "moduleB/pages/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion demo/taro-app/project.private.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"setting": {
"compileHotReLoad": true
"compileHotReLoad": false
},
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "taro-app"
Expand Down
22 changes: 21 additions & 1 deletion demo/taro-app/src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,25 @@ export default {
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
}
},
subpackages: [
{
root: "moduleA",
pages: [
"pages/index"
]
},
{
root: "moduleB",
pages: [
"pages/index",
],
independent: true
},
// {
// root: 'pages/sub',
// pages: ['sub-one/index'],
// independent: true,
// }
]
}
5 changes: 5 additions & 0 deletions demo/taro-app/src/moduleA/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { View } from '@tarojs/components'

export default () => {
return <View className="before:content-['moduleA_普通分包']">moduleA 普通分包</View>
}
3 changes: 3 additions & 0 deletions demo/taro-app/src/moduleB/pages/index.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
navigationBarTitleText: '独立分包'
}
2 changes: 2 additions & 0 deletions demo/taro-app/src/moduleB/pages/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import 'tailwindcss/base';
@import 'tailwindcss/utilities';
7 changes: 7 additions & 0 deletions demo/taro-app/src/moduleB/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { View } from '@tarojs/components'
import './index.scss'
// https://taro-docs.jd.com/docs/independent-subpackage
// https://developers.weixin.qq.com/miniprogram/dev/framework/subpackages/independent.html
export default () => {
return <View className="before:content-['moduleB_独立分包']">moduleB 独立分包</View>
}
5 changes: 4 additions & 1 deletion demo/taro-app/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable react/jsx-curly-brace-presence */
import { useState } from 'react'
import { View } from '@tarojs/components'
import { View, Navigator, Button } from '@tarojs/components'
import classNames from 'classnames'
// import { useEnv, useNavigationBar, useModal, useToast } from "taro-hooks";
// import { Button } from 'antd-mobile'
Expand All @@ -23,9 +23,12 @@ const Index = () => {
)
return (
<>
<Navigator url='/moduleA/pages/index'>普通分包</Navigator>
<Navigator url='/moduleB/pages/index'>独立分包</Navigator>
{/* <Button>Button</Button> */}
<View className={`w-full bg-indigo-400 bg-[url('https://xxx.com/xx.webp')] bg-bottom bg-contain bg-no-repeat`}>{'bg-[url]'}</View>
<View className={aaa}>11</View>
<View className='shadow-md'>shadow-md</View>
<View className='form-box py-[62px] rotate-45 px-[95px] bg-sky-500/80 dark:bg-[#123456]'>py-[62px] px-[95px]</View>
{/* @ts-ignore */}
<View emptyImageClass='w-[404px] h-[337px] bg-[#fff]' btnClassName='text-[#66ffff]'></View>
Expand Down
3 changes: 2 additions & 1 deletion demo/taro-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js,ts,jsx,tsx}"],
// https://github.com/mrmlnc/fast-glob
content: ["./src/**/*.{html,js,ts,jsx,tsx}", "!./src/moduleB/**/*.{html,js,ts,jsx,tsx}"],
darkMode: 'class',
theme: {
extend: {},
Expand Down
12 changes: 12 additions & 0 deletions demo/taro-app/tailwind.config.sub.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/moduleB/**/*.{html,js,ts,jsx,tsx}"],
darkMode: 'class',
theme: {
extend: {},
},
plugins: [],
corePlugins: {
preflight: false
}
}
Loading