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

wip(app): nvue

上级 b099fb20
...@@ -41,7 +41,7 @@ export function uniAppNVuePlugin(): Plugin { ...@@ -41,7 +41,7 @@ export function uniAppNVuePlugin(): Plugin {
const inputDir = process.env.UNI_INPUT_DIR const inputDir = process.env.UNI_INPUT_DIR
const mainPath = resolveMainPathOnce(inputDir) const mainPath = resolveMainPathOnce(inputDir)
function normalizeCssChunkFilename(id: string) { function normalizeCssChunkFilename(id: string) {
return removeExt(normalizePath(path.relative(inputDir, id))) + '.css' return removeExt(normalizePath(path.relative(inputDir, id))) + '.css.js'
} }
return { return {
name: 'uni:app-nvue', name: 'uni:app-nvue',
...@@ -78,16 +78,13 @@ export function uniAppNVuePlugin(): Plugin { ...@@ -78,16 +78,13 @@ export function uniAppNVuePlugin(): Plugin {
configResolved: createConfigResolved({ configResolved: createConfigResolved({
chunkCssFilename(id: string) { chunkCssFilename(id: string) {
if (id === mainPath) { if (id === mainPath) {
return 'app.css' return 'app.css.js'
} else if (isUniPageSfcFile(id, inputDir)) { } else if (isUniPageSfcFile(id, inputDir)) {
return normalizeCssChunkFilename(id) return normalizeCssChunkFilename(id)
} }
}, },
chunkCssCode(filename, cssCode) { chunkCssCode(_, cssCode) {
if (filename === 'app.css') { return 'export default {}'
return cssCode
}
return cssCode
}, },
}), }),
} }
......
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: ...@@ -648,6 +648,12 @@ importers:
devDependencies: devDependencies:
'@vue/compiler-core': 3.2.27 '@vue/compiler-core': 3.2.27
packages/uni-nvue-styler:
specifiers:
postcss: ^8.4.5
dependencies:
postcss: 8.4.5
packages/uni-quickapp-webview: packages/uni-quickapp-webview:
specifiers: specifiers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3030820220114003 '@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.
先完成此消息的编辑!
想要评论请 注册