We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm init ice icestark-framework @icedesign/stark-layout
希望可以想图片相关资源一样,可以正常导入
No response
"@ice/app": "^3.0.0",
import { defineConfig } from '@ice/app'; import icestark from '@ice/plugin-icestark'; import fusion from '@ice/plugin-fusion'; import store from '@ice/plugin-store'; import request from '@ice/plugin-request'; import { addLoader, modifyLoader, removeLoader } from '@ice/webpack-modify'; export default defineConfig(() => ({ ssg: false, plugins: [ fusion({ themePackage: '@alifd/theme-design-pro', theme: { 'css-prefix': 'next-icestark-', }, }), icestark({ type: 'framework' }), store(), request() ], webpack: (webpackConfig) => { return ['mp3', 'mp4', 'wav'].reduce((acc, cur) => { return modifyLoader(acc, { rule: `.${cur}`, loader: 'url-loader', options: (originOptions) => { return { name: '[name].[ext]', // 输出文件名保持原样 outputPath: 'assets/audio/', // 输出目录,可选 publicPath: 'assets/audio/' // 公共路径,如果需要的话 } }, }); }, webpackConfig); }, }));
The text was updated successfully, but these errors were encountered:
mp3 目前没有在框架的内置处理逻辑中,直接通过 addLoader 添加一条新的 webpack 处理规则就可以了
mp3
Sorry, something went wrong.
使用file-loader添加的规则不生效呢
还是同样的问题 @ClarkXia
@ClarkXia 大佬,能尽快回复一下吗?这个规则应该是怎么的?按照你们文档中提供的,好像不生效呢
直接操作 webpack 配置,不要用 modifyRule 这个,类似 webpackConfig.module.rules.push(newRule)
webpackConfig.module.rules.push(newRule)
完美解决,感谢
ClarkXia
No branches or pull requests
Describe the bug
npm init ice icestark-framework @icedesign/stark-layout
Expected behavior
希望可以想图片相关资源一样,可以正常导入
Actual behavior
No response
Version of ice.js
"@ice/app": "^3.0.0",
Content of build.json or ice.config.mts
Additional context
No response
The text was updated successfully, but these errors were encountered: