fix: fix responsive invalidation caused by upgrading build-plugin-component

This commit is contained in:
liujuping 2022-12-22 15:53:41 +08:00 committed by 林熠
parent 6bd60e3bbc
commit c7c7d93e1a
7 changed files with 80 additions and 3 deletions

View File

@ -13,7 +13,7 @@ export class SettingsMain {
private _sessionId = ''; private _sessionId = '';
@obx.ref private _settings?: SettingTopEntry | null = null; @obx.ref private _settings?: SettingTopEntry;
@computed get length(): number | undefined { @computed get length(): number | undefined {
return this._settings?.nodes.length; return this._settings?.nodes.length;

View File

@ -25,6 +25,25 @@ const releaseVersion = getVersion();
module.exports = ({ context, onGetWebpackConfig }) => { module.exports = ({ context, onGetWebpackConfig }) => {
onGetWebpackConfig((config) => { onGetWebpackConfig((config) => {
['jsx', 'tsx'].forEach((rule) => {
config.module
.rule(rule)
.exclude.clear()
.add(/node_modules(?!(.+_component_demo|.+build-plugin-component))/)
.end()
.use('babel-loader')
.tap((options) => {
const { plugins = [] } = options;
console.log('plugins', plugins);
return {
...options,
plugins: [
...plugins,
['@babel/plugin-proposal-class-properties', { loose: true }],
],
};
});
});
config.resolve config.resolve
.plugin('tsconfigpaths') .plugin('tsconfigpaths')
.use(TsconfigPathsPlugin, [{ .use(TsconfigPathsPlugin, [{

View File

@ -172,7 +172,7 @@ export async function init(
// 注册一批内置插件 // 注册一批内置插件
await plugins.register(OutlinePlugin); await plugins.register(OutlinePlugin);
await plugins.register(componentMetaParser(designer)); await plugins.register(componentMetaParser(designer));
await plugins.register(setterRegistry); await plugins.register(setterRegistry, {}, { autoInit: true });
await plugins.register(defaultPanelRegistry(editor, designer)); await plugins.register(defaultPanelRegistry(editor, designer));
await plugins.register(builtinHotkey); await plugins.register(builtinHotkey);

View File

@ -6,6 +6,26 @@ const { version } = lernaConfig;
module.exports = ({ context, onGetWebpackConfig }) => { module.exports = ({ context, onGetWebpackConfig }) => {
onGetWebpackConfig((config) => { onGetWebpackConfig((config) => {
['jsx', 'tsx'].forEach((rule) => {
config.module
.rule(rule)
.exclude.clear()
.add(/node_modules(?!(.+_component_demo|.+build-plugin-component))/)
.end()
.use('babel-loader')
.tap((options) => {
const { plugins = [] } = options;
console.log('plugins', plugins);
return {
...options,
plugins: [
...plugins,
['@babel/plugin-proposal-class-properties', { loose: true }],
],
};
});
});
config.resolve.plugin('tsconfigpaths').use(TsconfigPathsPlugin, [ config.resolve.plugin('tsconfigpaths').use(TsconfigPathsPlugin, [
{ {
configFile: './tsconfig.json', configFile: './tsconfig.json',

View File

@ -1,5 +1,24 @@
module.exports = ({ onGetWebpackConfig }) => { module.exports = ({ onGetWebpackConfig }) => {
onGetWebpackConfig((config) => { onGetWebpackConfig((config) => {
['jsx', 'tsx'].forEach((rule) => {
config.module
.rule(rule)
.exclude.clear()
.add(/node_modules(?!(.+_component_demo|.+build-plugin-component))/)
.end()
.use('babel-loader')
.tap((options) => {
const { plugins = [] } = options;
console.log('plugins', plugins);
return {
...options,
plugins: [
...plugins,
['@babel/plugin-proposal-class-properties', { loose: true }],
],
};
});
});
config.performance.hints(false); config.performance.hints(false);
}); });
}; };

View File

@ -1,5 +1,24 @@
module.exports = ({ onGetWebpackConfig }) => { module.exports = ({ onGetWebpackConfig }) => {
onGetWebpackConfig((config) => { onGetWebpackConfig((config) => {
['jsx', 'tsx'].forEach((rule) => {
config.module
.rule(rule)
.exclude.clear()
.add(/node_modules(?!(.+_component_demo|.+build-plugin-component))/)
.end()
.use('babel-loader')
.tap((options) => {
const { plugins = [] } = options;
console.log('plugins', plugins);
return {
...options,
plugins: [
...plugins,
['@babel/plugin-proposal-class-properties', { loose: true }],
],
};
});
});
config.performance.hints(false); config.performance.hints(false);
}); });
}; };

View File

@ -133,7 +133,7 @@ export class BasicContext {
// 注册一批内置插件 // 注册一批内置插件
this.registerInnerPlugins = async function registerPlugins() { this.registerInnerPlugins = async function registerPlugins() {
await plugins.register(componentMetaParser(designer)); await plugins.register(componentMetaParser(designer));
await plugins.register(setterRegistry); await plugins.register(setterRegistry, {}, { autoInit: true });
await plugins.register(defaultPanelRegistry(editor, designer)); await plugins.register(defaultPanelRegistry(editor, designer));
await plugins.register(builtinHotkey); await plugins.register(builtinHotkey);
}; };