Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
64 changes: 64 additions & 0 deletions packages/vue3/build/broswer-vendors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const path = require('path');
const { defineConfig } = require('@rspack/cli');

const root = path.resolve(__dirname, '..');

const targets = ['last 2 versions', '> 0.2%', 'not dead', 'Firefox ESR'];

exports.vendorConfig = (type) =>
defineConfig({
mode: 'production',
devtool: 'source-map',
entry: {
index: [path.resolve(__dirname, '../src/broswer-vendors.ts')],
},
target: 'web',
output: {
publicPath: '/',
path: path.resolve(root, `dist/${type}`),
filename: `broswer-vendors.js`,
library: {
name: 'LcapBrowserVendors',
type: 'umd',
umdNamedDefine: true,
export: 'default',
},
Comment thread
YufJi marked this conversation as resolved.
},
module: {
rules: [
{
test: /\.[mc]?js$/,
type: 'javascript/auto',
use: [
{
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'ecmascript',
},
},
},
},
],
},
{
test: /\.ts$/,
use: [
{
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
},
},
env: { targets },
},
},
],
},
],
},
stats: 'minimal',
});
3 changes: 2 additions & 1 deletion packages/vue3/build/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const { defineConfig } = require('@rspack/cli');
const rspack = require('@rspack/core');
const { VueLoaderPlugin } = require('vue-loader');
const { vendorConfig } = require('./broswer-vendors');

const root = path.resolve(__dirname, '..');
const library = 'cloudAdminDesigner';
Expand Down Expand Up @@ -116,4 +117,4 @@ const baseConfig = (type) =>
stats: 'minimal',
});

module.exports = [baseConfig('pc'), baseConfig('mobile')];
module.exports = [baseConfig('pc'), baseConfig('mobile'), vendorConfig('pc'), vendorConfig('mobile')];
4 changes: 2 additions & 2 deletions packages/vue3/source/src/hooks/datasource-utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _isEqual from 'lodash/isEqual';
import { isEqual } from 'lodash';
Comment thread
YufJi marked this conversation as resolved.

export function useDataSourceUtils() {
const cache = new Map();
Expand All @@ -12,7 +12,7 @@ export function useDataSourceUtils() {
// null 直接比较
if (a === null || b === null) return a === b;
if (typeof a === 'object') {
return _isEqual(a, b);
return isEqual(a, b);
}
return Object.is(a, b);
});
Expand Down
13 changes: 13 additions & 0 deletions packages/vue3/src/broswer-vendors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Vue from 'vue';
import * as VueRouter from 'vue-router';
import * as Pinia from 'pinia';
import * as VueI18n from 'vue-i18n';
import * as VueCompilerSFC from 'vue/compiler-sfc';
import lodash from 'lodash';

window.Vue = Vue;
window.VueRouter = VueRouter;
window.Pinia = Pinia;
window.VueI18n = VueI18n;
window.VueCompilerSFC = VueCompilerSFC;
window.Lodash = lodash;
Comment thread
YufJi marked this conversation as resolved.
Loading