-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathice.config.js
More file actions
25 lines (24 loc) · 862 Bytes
/
ice.config.js
File metadata and controls
25 lines (24 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module.exports = {
injectBabel: 'runtime',
publicPath: './',
plugins: [
['ice-plugin-fusion', {}],
'ice-plugin-component',
],
chainWebpack: (config, { command }) => {
// 内置 jsx 和 tsx 规则均会使用到 babel 配置
['jsx', 'tsx'].forEach((rule) => {
config.module
.rule(rule)
.use('babel-loader')
.tap((options) => {
// 添加一条 babel plugin,同理可添加 presets
options.plugins.push(require.resolve('babel-plugin-transform-jsx-list'));
options.plugins.push(require.resolve('babel-plugin-transform-react-es6-displayname'));
options.plugins.push(require.resolve('babel-plugin-transform-object-assign'));
options.plugins.push(require.resolve('babel-plugin-transform-proto-to-assign'));
return options;
});
});
}
};