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

wip(app): nvue

上级 b099fb20
......@@ -41,7 +41,7 @@ export function uniAppNVuePlugin(): Plugin {
const inputDir = process.env.UNI_INPUT_DIR
const mainPath = resolveMainPathOnce(inputDir)
function normalizeCssChunkFilename(id: string) {
return removeExt(normalizePath(path.relative(inputDir, id))) + '.css'
return removeExt(normalizePath(path.relative(inputDir, id))) + '.css.js'
}
return {
name: 'uni:app-nvue',
......@@ -78,16 +78,13 @@ export function uniAppNVuePlugin(): Plugin {
configResolved: createConfigResolved({
chunkCssFilename(id: string) {
if (id === mainPath) {
return 'app.css'
return 'app.css.js'
} else if (isUniPageSfcFile(id, inputDir)) {
return normalizeCssChunkFilename(id)
}
},
chunkCssCode(filename, cssCode) {
if (filename === 'app.css') {
return cssCode
}
return cssCode
chunkCssCode(_, cssCode) {
return 'export default {}'
},
}),
}
......
import { parse } from '../src'
describe('mp-weixin: transform v-on', () => {
test('basic', () => {
console.log(parse(`.test{color:red}`))
})
})
{
"name": "@dcloudio/uni-nvue-styler",
"version": "3.0.0-alpha-3030820220114003",
"description": "uni-nvue-styler",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-nvue-styler"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"license": "Apache-2.0",
"dependencies": {
"postcss": "^8.4.5"
}
}
import postcss from 'postcss'
export function parse(input: string) {
return postcss.parse(input)
}
{
"extends": "../../tsconfig.node.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"src",
"types/shims.d.ts",
"../shims-node.d.ts",
"../shims-uni-app.d.ts"
]
}
......@@ -648,6 +648,12 @@ importers:
devDependencies:
'@vue/compiler-core': 3.2.27
packages/uni-nvue-styler:
specifiers:
postcss: ^8.4.5
dependencies:
postcss: 8.4.5
packages/uni-quickapp-webview:
specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3030820220114003
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册