feat: 🎸 完善 Rax 出码的时候的全局样式处理

This commit is contained in:
牧毅 2020-08-14 11:09:31 +08:00
parent 202ade47a2
commit 058b087a2b
7 changed files with 14 additions and 7 deletions

View File

@ -24,6 +24,8 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
content: ` content: `
import { runApp } from 'rax-app'; import { runApp } from 'rax-app';
import appConfig from './app.json'; import appConfig from './app.json';
import './global.scss';
`, `,
linkAfter: [], linkAfter: [],
}); });

View File

@ -21,9 +21,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
type: ChunkType.STRING, type: ChunkType.STRING,
fileType: FileType.SCSS, // TODO: 样式文件的类型定制化? fileType: FileType.SCSS, // TODO: 样式文件的类型定制化?
name: COMMON_CHUNK_NAME.StyleDepsImport, name: COMMON_CHUNK_NAME.StyleDepsImport,
content: ` content: ``,
// TODO: 引入默认全局样式
`,
linkAfter: [], linkAfter: [],
}); });

View File

@ -1,4 +1,6 @@
import { runApp } from 'rax-app'; import { runApp } from 'rax-app';
import appConfig from './app.json'; import appConfig from './app.json';
import './global.scss';
runApp(appConfig); runApp(appConfig);

View File

@ -1,5 +1,3 @@
// TODO: 引入默认全局样式
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }

View File

@ -1,4 +1,6 @@
import { runApp } from 'rax-app'; import { runApp } from 'rax-app';
import appConfig from './app.json'; import appConfig from './app.json';
import './global.scss';
runApp(appConfig); runApp(appConfig);

View File

@ -1,5 +1,9 @@
// TODO: 引入默认全局样式
body { body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
page,
body {
width: 750rpx;
overflow-x: hidden;
}

View File

@ -341,6 +341,7 @@
}, },
}, },
], ],
css: 'page,body{\n width: 750rpx;\n overflow-x: hidden;\n}',
config: { config: {
sdkVersion: '1.0.3', sdkVersion: '1.0.3',
historyMode: 'hash', historyMode: 'hash',