ice icon indicating copy to clipboard operation
ice copied to clipboard

webpack模式下不支持.otf引入,且手动配置后热更新会触发两次编译

Open cuiaiguanggh opened this issue 4 years ago • 1 comments

What is the current behavior? 发生了什么?

webpack模式下不支持.otf引入,且手动配置后热更新会触发两次编译: 按照下面截图1配置可以支持.otf格式字体的引入,但是这样配置之后每次修改代码会出现两次热更新(截图2) 截图1: image 截图2: image

What is the expected behavior? 期望的结果是什么?

1.能够内置支持.otf字体 2.修改代码热编译做到一次

Any additional comments? 相关环境信息?

  • ice.js Version:2.6.2

  • build.json Configuration

  • import legacy from '@vitejs/plugin-legacy'; import themeConfig from './config/theme'; const apis = { mock: 'https://www.fastmock.site/mock/4b7bddccf06a89b347695ca5672a01f2/v2/', }; export default { hash: process.env.NODE_ENV === 'production', plugins: [ [ 'build-plugin-antd', { disableModularImport: true, themeConfig, }, ], ], postcssOptions: { plugins: { 'postcss-pxtorem': { rootValue: 192, propList: ['*'], selectorBlackList: ['.norem'], }, }, }, alias: { utils: './src/utils', }, define: { APP_VERSION: '0.1.0', //全局变量 }, proxy: { '/m-api/': { enable: true, target: apis.mock, changeOrigin: true, pathRewrite: { '^/m-api/': '/' }, }, }, "minify": { "type": "esbuild", }, modeConfig: { //平台差异化配置 vite: { vite: true, vitePlugins: [ legacy({ targets: ['defaults', 'not IE 11'], }), ], outputDir: 'dist', }, webpack: { outputDir: 'dist_webpack', // remoteRuntime: true, babelPresets: ['@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }]], webpackLoaders: { file: { test: /.(otf)$/, type: 'asset/resource', loaders: { 'file-loader': {}, }, include: ['src'], }, }, }, }, };

  • Node Version:v16.14.2

  • Platform:mac os

cuiaiguanggh avatar Apr 27 '22 03:04 cuiaiguanggh

无法简单复现,建议提供一个demo

ClarkXia avatar Jun 10 '22 02:06 ClarkXia

因长期未提供复现 demo ,建议提供后重开 issue

ClarkXia avatar Sep 21 '22 02:09 ClarkXia