feat(app,utils,runtime): 将resetcss.css移到utils,在runtime中引入

This commit is contained in:
roymondchen 2023-06-08 17:44:06 +08:00
parent ed4b3c77ef
commit 01d1dccbb6
13 changed files with 20 additions and 3 deletions

View File

@ -18,8 +18,6 @@
import App from './App';
import './resetcss.css';
export * from './events';
export { default as Env } from './Env';

View File

@ -9,6 +9,10 @@
".": {
"import": "./dist/tmagic-utils.js",
"require": "./dist/tmagic-utils.umd.cjs"
},
"./resetcss.css": {
"import": "./src/resetcss.css",
"require": "./src/resetcss.css"
}
},
"license": "Apache-2.0",

View File

@ -30,6 +30,7 @@
v-if="previewVisible"
ref="iframe"
width="100%"
style="border: none"
:height="stageRect && stageRect.height"
:src="previewUrl"
></iframe>

View File

@ -28,6 +28,7 @@ export default defineConfig({
alias: [
{ find: /^react$/, replacement: path.join(__dirname, 'node_modules/react/index.js') },
{ find: /^react-dom$/, replacement: path.join(__dirname, 'node_modules/react-dom/index.js') },
{ find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') },
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') },
{ find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') },
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') },

View File

@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import ReactDOM from 'react-dom';
@ -28,6 +27,8 @@ import components from '../.tmagic/comp-entry';
import plugins from '../.tmagic/plugin-entry';
import App from './App';
import '@tmagic/utils/resetcss.css';
declare global {
interface Window {
magicDSL: MApp[];

View File

@ -31,6 +31,8 @@ import plugins from '../.tmagic/plugin-entry';
import App from './App';
import '@tmagic/utils/resetcss.css';
declare global {
interface Window {
appInstance: Core;

View File

@ -27,6 +27,7 @@ export default defineConfig({
resolve: {
alias: [
{ find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm.js') },
{ find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') },
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') },
{ find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') },
{ find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') },

View File

@ -28,6 +28,8 @@ import request from './utils/request';
import AppComponent from './App.vue';
import { getLocalConfig } from './utils';
import '@tmagic/utils/resetcss.css';
Vue.use(request);
const app = new Core({

View File

@ -22,6 +22,8 @@ import Core from '@tmagic/core';
import App from './App.vue';
import '@tmagic/utils/resetcss.css';
Promise.all([import('../.tmagic/comp-entry'), import('../.tmagic/plugin-entry')]).then(([components, plugins]) => {
Object.entries(components.default).forEach(([type, component]: [string, any]) => {
Vue.component(`magic-ui-${type}`, component);

View File

@ -28,6 +28,7 @@ export default defineConfig({
resolve: {
alias: [
{ find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm-bundler.js') },
{ find: /^@tmagic\/utils\/resetcss.css/, replacement: path.join(__dirname, '../../packages/utils') },
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') },
{ find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') },
{ find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') },

View File

@ -28,6 +28,8 @@ import request from './utils/request';
import AppComponent from './App.vue';
import { getLocalConfig } from './utils';
import '@tmagic/utils/resetcss.css';
const magicApp = createApp(AppComponent);
magicApp.use(request);

View File

@ -22,6 +22,8 @@ import Core from '@tmagic/core';
import App from './App.vue';
import '@tmagic/utils/resetcss.css';
Promise.all([import('../.tmagic/comp-entry'), import('../.tmagic/plugin-entry')]).then(([components, plugins]) => {
const magicApp = createApp(App);